[Zope-DB] Calling a Product method from a ZSQL Method

Santi Camps santi at zetadb.com
Wed Nov 26 12:14:34 EST 2003


Hi all,

I've created a class inheriting from ZSQL Methods.  Now I would like to
call a public method defined in this class from ZSQL code, but I'm not
able to do it.  I can call methods from parent objects, but not my own
class methods.

For instance:  Container1/ZSQL1

Supose that ZSQL1 is from class CustomSQL, that has a public method
sql_method.  And Container1 is from class CustomContainer, that has a
public method container_method

If in ZSQL1 I try this code:
select <dtml-var expr="container_method(params)"> from anytable
works fine

But trying:
select <dtml-var expr="sql_method(params)"> from anytable
or 
select <dtml-var expr="_.sql_method(params)"> from anytable
raises an AttributeError exception


Is there any way to do it?  Any syntax to call a method defined in the
same ZSQL class?

Thanks in advance

Santi Camps
http://zetadb.sourceforge.net




More information about the Zope-DB mailing list