[Zope] Returning lists of tuples

James W. Howe jwh@allencreek.com
Mon, 28 Feb 2000 13:07:44 -0500


I've got situation where I want a dtml-method to return a list of tuple 
objects.  I then want to iterate over the tuples using a dtml-in construct, 
displaying the various parts of the tuple.  For example, suppose I want to 
return a list of URL tags and names like this:

<dtml-return "[('Go Here', 'foo.bar.com') , ('Go Somewhere Else', 
'baz.foo.com')]">

I would like to do something like this with this result:

<dtml-in urltags>
<a href="< url part from tuple >">< display part of tuple ></a>
</dtml-in>

Is there a way to do this and if so, what is the magical syntax to make 
this happen?  I'm also interested in knowing how I might use a collection 
of mapping objects in a similar manner.

Thanks!

James W. Howe				mailto:jwh@allencreek.com
Allen Creek Software, Inc.		pgpkey: http://ic.net/~jwh/pgpkey.html		
Ann Arbor, MI  48103