Hi, my python script returns an array of dictionaries, like: [{'num':1, 'letter':'a'},{'num':2, 'letter':'b'}] in a dtml-document I try to print these values: <dtml-in "script(param=param)"> <dtml-var num><br><dtml-var letter> </dtml-in> This results in a key error. How do I have to return the values to make the dtml-code work? I know <dtml-var "_['sequence-item']['num']"> works, but I want<dtml-var num> to work. Thanks Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06
Like this: <dtml-in "script(param=param)" mapping> <dtml-var foo> </dtml-in> -Magnus
At 00:00 19.05.2001 +0200, magnus/Websys@websys.no wrote:
Like this:
<dtml-in "script(param=param)" mapping> <dtml-var foo> </dtml-in>
thanks! That worked! But why do I have to say mapping? Other Scripts or Objects don't have to. Regards Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06
Hi Ulrich, try {'foo':'bar'}.foo in a python interpreter :-) If you want attribute access you have to make a class and define __getattr__() in it. Regards Tino --On Samstag, 19. Mai 2001 13:06 +0200 Ulrich Wisser <u.wisser@publisher.de> wrote:
At 00:00 19.05.2001 +0200, magnus/Websys@websys.no wrote:
Like this:
<dtml-in "script(param=param)" mapping> <dtml-var foo> </dtml-in>
thanks! That worked!
But why do I have to say mapping? Other Scripts or Objects don't have to.
Regards
Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
magnus/Websys@websys.no -
Tino Wildenhain -
Ulrich Wisser