[Zope] Returning lists from python back to dtml

Isokangas, Erik HTC/DE/FRA Erik.Isokangas@hochtief.de
Thu, 25 Jul 2002 15:57:51 +0200


Hi,

I must admit I'm relatively new to both python and Zope but have a problem
which I can't find the solution to in the (easy-to-reach) documentation.  A
lot has been written about passing data from dtml to python scripts, but not
much in the other direction.

I have no problems returning simple lists, e.g.
# getResults
return (1,2,3,4,5)

...where the results are returned to a dtml method using something like:
<dtml-in "getResults()">
   <dtml-var sequence-item>
   </dtml-in>

However, I wish to pass a table of results with 'column names' (in layman's
terms), such that I can read the returned results something like...
<dtml-in "getResults()">
   <dtml-var Column1> <dtml-var Column2> <dtml-var Column3>
   </dtml-in>

So, how do I pass named results from python script to dtml?

Thanks for your thoughts.

Erik.