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: 
>  <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)"/>

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.

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-users mailing list

Reply via email to