[Zope] RE: DTML question
Amos Latteier
Amos@digicool.com
Tue, 30 Mar 1999 13:55:50 -0500
> Sorry to bother you with these questions but I can't post to
> egroups. I
> tried senting messages on friday, saturday, monday and
> today but none
> went through. I've sent from the egroups post page, and from my
> email... no luck. Please feel free to cc the list with
> any answers
> or pointers to answers.
You can post to the list without egroups by sending mail to
zope@zope.org. You can also read the archives without egroups at
http://www.zope.org/pipermail/zope/.
> I've been working throught the DTML manual and I've come
> across a problem;
> I can't get the #in tag
> to do what I want with a dictionary. I'm using it from
> Python for now, but
> plan to use this within a Zope app soon.
>
>
> The following DTML code exits with this error: "...line 641,
> in renderwob
> l-len(sequence)"
>
> <!--#in dictionary mapping -->
> <!--#var sequence-key --> <!--#var sequence-item -->
> <!--#/in -->
I think what you want is access to the dictionary's items() right?
<!--#in "dictionary.items()"-->
<!--#var sequence-key--> : <!--#var sequence-item-->
<!--#/in-->
The mapping attribute is not relevant here. It means treat
sequence-items as mappings not instances, that is to say, look up vars
with __getitem__, not __getattr__.
The DTML User's Guide is your friend.
-Amos