[Zope] Calling a ZSQL methods from an external method

J C Lawrence claw@kanga.nu
Fri, 11 Feb 2000 07:07:57 -0800


On Thu, 10 Feb 2000 10:34:55 -0800 
Nick Garcia <ngarcia@codeit.com> wrote:

> J C Lawrence wrote:<dtml-sqltest CatID type=int>

>>  Would someone who is successfully calling a ZSQL methods from an
>> external method mind dropping me their recipe?  I'm following the
>> HOW-TO exactly, but it keeps complaining that I can't find my
>> database connector (and is using the wrong name to find it).

> There isn't any special trick to it.  The external method takes
> self as an argument, and in the code I just call self.sqlMethod().

Okay, I've got that, except that I have a single extension in that
my ZSQL method takes an argument.  I'm trying to call it ala:

  results=self.GetCat (CatID=str(catID))

where "GetCat" is the SQL Method.    

So my external method reads:

  def CategoryPath (self, baseURL, catID):
    while (catID != 0):
      results=self.GetCat (CatID=int(catID))

This isn't working.  I can't tell you if its the argument that's the
problem, as the manifestation is that it can't find the right DB
connector.

-- 
J C Lawrence                                 Home: claw@kanga.nu
----------(*)                              Other: coder@kanga.nu
--=| A man is as sane as he is dangerous to his environment |=--