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?
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. regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Mitchell L Model Sent: Thursday, September 20, 2001 10:57 PM To: zope@zope.org Subject: [Zope] dtml-in and dictionaries
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?
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
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?
if you have a dictionary with keys 'a', 'b', 'c' the following should work: : <dtml-in dict mapping> <dtml-var name="a"> <dtml-var name="b"> <dtml-var name="c"> </dtml-in> jens On Thursday, September 20, 2001, at 07:21 , Mitchell L Model wrote:
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.
participants (3)
-
Jens Vagelpohl -
Max M -
Mitchell L Model