[Zope] converting Dictionary to Result
Dieter Maurer
dieter at handshake.de
Wed Jun 21 17:35:30 EDT 2006
Alric Aneron wrote at 2006-6-19 09:35 -0700:
> ...
>contents of myscript():
>mydict = {'key1': 'value1', 'key2': 'value2'}
>mydict2 = {'key1': 'value3', 'key2': 'value4'}
>finalList = [mydict, mydict2]
>return finalList
>
>When I do this in a dtml-method:
><dtml-in "myscript()">
> <dtml-var key1> <br/>
></dtml-in>
>This will not return me this:
>value1
>value2
>It gives me a key error.
You should tell the "dtml-in" that it is iterating over
a sequence of "mapping" objects. You do this with its
"mapping" attribute.
--
Dieter
More information about the Zope
mailing list