[Zope] is possible use request.set in a zpt?

Andreas Jung lists at zopyx.com
Sat Jun 27 12:36:58 EDT 2009


On 27.06.09 17:15, Miguel Beltran R. wrote:
>
>
>
>     It is possible...
>
>      <div tal:define="ignored python:request.set('sumVar', 0)">
>
>     but not recommended.  The kind of logic you are trying to wedge
>     into the
>     template should be pushed out into a Python script, leaving the
>     template
>     only with the job of rendering the results.
>
>
>     Tres.
>     - --
>
>
> I want show tabular data with money and the last show the sum
> can you explain me how can made better this then? almost never use
> python script :P

Huh? Write a PythonScript (yes, you should know some basic Python)
returning the
data as dict or list or something similar...then render the result as needed
using ZPT. Should be documented in The Zope Book (docs.zope.org).

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20090627/21be97f5/attachment.vcf 


More information about the Zope mailing list