Re: [Zope] Arrg! dtml-in can't handle lists of pairs!
"Cary O'Brien" <cobrien@Radix.Net> writes:
It seems as if dtml-in handles lists of pairs specially. It does, and it is documented.
Where? I even looked through the code in DT_In.py and couldn't figure out where it handled this special case. This seems to me like a pretty big gotcha. I did find out that a list of two items was not handled the same way as a tuple of two items. Unfortunately I couldn't figure out how to invoke list().
For pairs, the first component becomes "sequence-key" and the second "sequence-item".
Not a good thing. Can I supress this behavior? Not that I know.
Well, the only solution I came up with was to iterate with an index over the size of the thing. -- cary
Cary O'Brien writes:
"Cary O'Brien" <cobrien@Radix.Net> writes:
It seems as if dtml-in handles lists of pairs specially. It does, and it is documented.
Where? I even looked through the code in DT_In.py and couldn't figure out where it handled this special case. This seems to me like a pretty big gotcha. From Document Template User Guide: dtml_in -> variables defined
sequence-key The key associated with the element in an items sequence. An items sequence is a sequence of value pairs that represent a mapping from a key to a value. Dieter
participants (2)
-
Cary O'Brien -
Dieter Maurer