RE: [Zope] What to do when an External Method returns a dictionar y
<!--#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).
Jeffrey Shell wrote:
<!--#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).
Ah, how lame of me (mapping). Thankyouverymuch.
participants (2)
-
Jeffrey Shell -
Morten W. Petersen