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. Thank you! Tino Wildenhain
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
participants (2)
-
Michel Pelletier -
Tino Wildenhain