[Zope] dtml-in and dictionaries

Mitchell L Model mlm@acm.org
Thu, 20 Sep 2001 19:21:01 -0400


>As far as I remember:
>
><dtml-in "someDict.values()">
><dtml-var sequence-key><dtml-var sequence-value>
></dtml-in>
>
>Or something similar. Try the dtml docs.
>

I did, and I didn't find anything about dictionaries, except a 
mysterious mapping attribute for dtml-in that didn't seem to help.

I couldn't get the above suggestion to work, but if I replace 'value' 
with 'item, it worked:

<dl>
<dtml-in "dict.items()">
<dt><dtml-var sequence-key>
<dd><dtml-var sequence-item>
</dtml-in>
</dl>

Thanks for the suggestion.

I'd still like to see a dtml-in example using mapping.


>  >
>>
>>  I want to use dtml-in on the dictionary to get something like
>>
>>	<dt>KEY<dd>VALUE
>>
>  > for each entry in the dictionary.  What's the recommended idiom for this?
>  >