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

Tres Seaver tseaver at palladion.com
Fri Jun 26 22:34:40 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Miguel Beltran R. wrote:
> Hi list
> 
> I used before with dtml something like this
> <dtml-call "request.set('sumVar',0)">
> <dtml-in ...>
>    <dtml-call "request.set('sumVar', sumVar + queryVar)">
> </dtml-in>
> The sum is <dtml-var sumVar>
> 
> This is possible to made with ZPT?

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.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKRYVA+gerLs4ltQ4RAoaPAKCs6/ILvD+1i5kA5UtVvqJwWpk+xwCg2u++
5aEKQ0j4qUQdx23uC5gsD94=
=zdwr
-----END PGP SIGNATURE-----



More information about the Zope mailing list