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

2006-06-01 Thread Stephan Richter
On Monday 29 May 2006 13:49, Paolo Cilmo wrote:
>  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: 
>  
>  
>  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: 
>  

This works like you wrote it, however it is strongly discourage. Instead, you 
should write a view class that does all the logic and just insert the results 
into the template. There is a lot of documentation and code out there that 
describes how to develop views properly.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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

2006-05-29 Thread David Johnson
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:
> 
> 
> 
> 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:
> 
> 
> 
> 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:
> 
> 
> 
> 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@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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

2006-05-29 Thread Paolo Cilmo
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: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: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: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@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users