[Zope] What to do when an External Method returns a dictionar y

Jeffrey Shell Jeffrey@digicool.com
Tue, 28 Sep 1999 16:44:35 -0400


> <!--#var "core.newcurrenttime(nowtime())"--> returns a list,
> however, I can't seem to fetch the variables it returns.. :\
> 
> Any ideas, a pointer to the relevant python code, etc.?

If it returns a dictionary, use dtml-with

<dtml-with expr="core.newcurrenttime(nowtime())" mapping>
 <dtml-var key1>, <dtml-var keyfoo>
</dtml-with>

If it returns a list (sequence), use dtml-in.  If it's a list of
dictionaries, use the mapping attribute on the dtml-in tag (this lets
the dtml-in and dtml-in tags know to use getitem instead of getattr).