[Zope3-Users] Call a Python method from a ZPT
Paolo Cilmo
blackeight_zope at yahoo.it
Mon May 29 13:49:09 EDT 2006
Hi, i have to call a method of a package from a ZPT.
In Zope2, i make the Poll Product (Dev_Guide 2_4). In the example i can call "getVotesFor" method simply writing in ZPT (in ZMI) this line:
<span tal:replace="python:context.poll1.getVotesFor(j)"/>
and it works
In Zope3, i made the same product (package). From a ZPT page (in ZMI), i can call a method of Poll if the method don't take arguments, for example with:
<span tal:replace="context/poll1/getQuestion">
where poll1 is an istance of Poll package and it is in the same folder of the ZPT page. This works because the method don't take arguments, i just wan't call a method with parameters in Zope3, writing something like:
<span tal:replace="python:context.poll1.getVotesFor(j)"/>
Please help me.
Thanks
Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20060529/4f9a933e/attachment.htm
More information about the Zope3-users
mailing list