[Zope3-Users] Call a Python method from a ZPT

David Johnson djohnson at jsatech.com
Mon May 29 19:28:44 EDT 2006


The format is the same.  Do you have more details?  Are you getting
errors?  I've used this to embed variables to pass to an SQL database
for example.

On Mon, 2006-05-29 at 19:49 +0200, Paolo Cilmo wrote:
> 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 
> 
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users



More information about the Zope3-users mailing list