What to do when an External Method returns a dictionary
<!--#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.? -Thank you
<!--#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.?
why not assign it to a variable in REQUEST. <dtml-call "REQUEST.set(tempvar, core.newcurrenttime(nowtime()))"> then you can refer to it repeated without having to call the external method again ~~~~~~~~~~~~~~~~~~~~~~~~ or loop over it with dtml-in if you wish to use the results immediately. <dtml in "core.newcurrenttime(nowtime())"> ... </dtml-in> ~~~~~~~~~~~~~~~~~~~~~~~~ Both are untested and just guessing. chas
chas 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.?
why not assign it to a variable in REQUEST.
<dtml-call "REQUEST.set(tempvar, core.newcurrenttime(nowtime()))">
then you can refer to it repeated without having to call the external method again
~~~~~~~~~~~~~~~~~~~~~~~~
or loop over it with dtml-in if you wish to use the results immediately.
<dtml in "core.newcurrenttime(nowtime())"> ... </dtml-in>
~~~~~~~~~~~~~~~~~~~~~~~~
The method returns a dictionary (see subject), but I called it a list. Good idea with the temp var. Thankyouverymuch.
participants (2)
-
chas -
Morten W. Petersen