[Zope] Dictionary in ZPT

Andreas Jung lists at zopyx.com
Tue Sep 12 09:21:49 EDT 2006



--On 12. September 2006 14:16:23 +0100 Alan <alanwilter at gmail.com> wrote:

> Dears,
>
> I am looking for help.
>
> I want to pass, when submitting a FORM from a page template, dictionary.
>
> I started with that:
> tal:define="global count python: 0; global data python: {}"
> ...
> and I would like to do something like:
>   tal:define="global data['jname'] python: jname"
> or
>   tal:define="global null python: data['jname']=jname"
>

You can perform assignment that way in ZPT. First it is bad style.
You really want to prepare your data inside a PythonScript, call
the script from a ZPT and re-use the data as returned from the script.
If you don't want follow that road, try this:

tal:define="dummy python: somedict.update({key:value})"

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20060912/66faf60e/attachment.bin


More information about the Zope mailing list