[Zope] Dictionary in ZPT

Martijn Pieters mj at zopatista.com
Tue Sep 12 09:23:57 EDT 2006


On 9/12/06, Alan <alanwilter at gmail.com> wrote:
> 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"

Just tal:define="null python:data['jname'] = jname" should do. No need
to make the dummy var global anyway.

> But I get only error.

Traceback please. What is the error?

> Is there a way of creating and increasing a dict inside Zope template page?

Why do you want to? Use a python script instead, or better still, use
a Zope3-style view.

-- 
Martijn Pieters


More information about the Zope mailing list