[Zope] creating dictionaries

Michel Pelletier michel@digicool.com
Thu, 16 Mar 2000 12:13:57 -0800


Tino Wildenhain wrote:
> 
> Hello,
> 
> I want to create a dictionary to eliminate some multiple occurences
> of data.
> I have two <dtml-in> tags and inside I want to add items to the
> dictionary:
> 
> <dtml-let d="{}">
>         <dtml-in somesql1>
>                 <dtml-in somesql2>
>                         do something like: d[key]=value
>                 </dtml-in>
>         </dtml-in>
> 
> do something with the resulting dictionary...
> </dtml-let>
> 
> so far so good. But how to I add items to the dictionary?
> 
> <dtml-call "d[key]=value">  gives me syntax error.

Assignment cannot be done in DTML, it is a security risk.  DTML was not
designed to be a general purpose programming language; it's meant to be
a reporting language.  Use python (either external methods or
PythonMethods) if you want to do this.

-Michel