Is this behaviour a bug? I have all my ZSQL methods collected together in a folder. If I call these from a sibling folder[1] without any arguments, ie. <!--#in "sql.company"--> I get the below error, if I call them with specific arguments, ie. <!--#in "sql.company(comp_id=_['comp_id'])"--> I get no errors. (comp_id was in REQUEST in both cases). [1] by sibling folder I mean something like the following arrangement... /sql/company (where the sql method is stored) /lists/company_list (where the call is made) Here's the error: <!-- Error type: Error value: 0 --> Traceback (innermost last): File lib/python/ZPublisher/Publish.py, line 877, in publish_module File lib/python/ZPublisher/Publish.py, line 590, in publish (Info: /filter/contacts/index_html) File lib/python/OFS/DTMLDocument.py, line 212, in __call__ (Object: index_html) File lib/python/OFS/DTMLDocument.py, line 208, in __call__ (Object: index_html) File lib/python/DocumentTemplate/DT_String.py, line 513, in __call__ (Object: index_html) File lib/python/DocumentTemplate/DT_In.py, line 656, in renderwob (Object: sql.companies) File lib/python/Shared/DC/ZRDB/DA.py, line 420, in __getitem__ (Object: CopySource) File lib/python/Shared/DC/ZRDB/Aqueduct.py, line 332, in __getitem__ KeyError: (see above) Looking into it, line 332 in Aqueduct.py is a simple key lookup... def __getitem__(self, key): return self._data[key] It would seem that an argument is getting passed in by default when the sql in put in a parent's subfolder. --- John Eikenberry [jae@kavi.com - http://taos.kavi.com/~jae/] ______________________________________________________________ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin
At 01:56 10/03/99 , John Eikenberry wrote:
Is this behaviour a bug?
I have all my ZSQL methods collected together in a folder. If I call these from a sibling folder[1] without any arguments, ie.
<!--#in "sql.company"-->
I get the below error, if I call them with specific arguments, ie.
<!--#in "sql.company(comp_id=_['comp_id'])"-->
I get no errors. (comp_id was in REQUEST in both cases).
Because you are calling "sql.company" (in quotes), it is assumed to be an expression, and your expression is referencing an attribute, not a method. Try using the following: "sql.company()", or sql.company (without quotes). Note: I didn't test either method. -- M.J. Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-6254545 Fax: +31-35-6254555 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
participants (2)
-
John Eikenberry -
Martijn Pieters