[Zope-dev] Returning lists of Tuples from External Methods

Phillip J. Eby pje@telecommunity.com
Mon, 08 Nov 1999 18:01:41 -0500


At 02:48 PM 11/8/99 -0800, David S. Harrison wrote:
>
>But if I return
>a two element tuple, I get a list of the second element of the tuple
>when I use <dtml-in>.  I suspect Zope is doing something like
>interpreting the tuple list as name/value pairs and adding them
>to the namespace.  But I haven't found any documentation on it.
>Any clues on what is happening here?

When iterating over a sequence of two-item tuples, <dtml-in> puts the first
item into "sequence-key" and the second into "sequence-item".  It is indeed
treating the sequence as a .items() style list.