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

Peter Sabaini peter at sabaini.at
Wed Nov 26 14:56:52 EST 2003

Interesting, I guess that the RestrictedDTML object responsible for 
rendering the template might play tricks here.

This should work though:

<dtml-var expr="ZSQL1.sql_method()">


Santi Camps wrote:
> 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
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3216 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.zope.org/pipermail/zope-db/attachments/20031126/a89a8f80/smime.bin

More information about the Zope-DB mailing list