8 Aug
2003
8 Aug
'03
6:52 a.m.
On Thu, 2003-08-07 at 21:15, Ben Bush wrote:
How do I address each item in the list? Can you give me an example if I were to return a list of integers and a dicitionary list.
Sure. Search the online help for "in" for details. -------- <dtml-call "REQUEST.set('my_list', [{'foo': 1, 'bar':2}, {'foo': 3, 'bar':5}])"> <dtml-in my_list prefix=list> foo: <dtml-var "list_item['foo']"> bar: <dtml-var "list_item['bar']"> </dtml-in> <dtml-call "REQUEST.set('my_dict', {'foo': 7, 'bar':8})"> <dtml-in "my_dict.items()" prefix=dict> <dtml-var dict_key>: <dtml-var dict_item> </dtml-in> ------- Running the above should produce: foo: 1 bar: 2 foo: 3 bar: 5 foo: 7 bar: 8 HTH, Dylan