R: [Zope] dtml-in and maps...
Because, as you seem to keep missing, i want to iterate over all the items in the map, but i won't know what their keys are!
By using with, i can bring the map into the name space... SO WHAT? I still don't know what keys were in the map!
Get the idea?
Ya men... [the `name' is not allways `name'] the idea is to make a temporary `sequence-item' So, you have to do something like this: <HTML> <BODY> <dtml-call "REQUEST.set('superList',[['string1',0,{'name1':'value1'}],['string2',1,{'name2' :'value2'}]])"> <dtml-in superList> <dtml-let temp_sequence_item="_['sequence-item']"> <dtml-in "temp_sequence_item[2].keys()"> <dtml-var sequence-item>:<dtml-var "temp_sequence_item[2][_['sequence-item']]"> </dtml-in> </dtml-let> <BR> </dtml-in> </BODY> </HTML> As you see, it's not so difficult :) OR you can try with an external method, the code wil not be so UNreadable... PM
On Wed, 12 Jul 2000, Marcel Preda wrote:
So, you have to do something like this: <HTML> <BODY> <dtml-call "REQUEST.set('superList',[['string1',0,{'name1':'value1'}],['string2',1,{'n ame2'
:'value2'}]])">
<dtml-in superList> <dtml-let temp_sequence_item="_['sequence-item']"> <dtml-in "temp_sequence_item[2].keys()"> <dtml-var sequence-item>:<dtml-var "temp_sequence_item[2][_['sequence-item']]"> </dtml-in> </dtml-let> <BR> </dtml-in> </BODY> </HTML>
Ok... i've fiddled around a bit, and It's working. Thanks. (o8 Have a better one, Curtis.
participants (2)
-
Curtis Maloney -
Marcel Preda