Wouldn't {{=item[link]}} be the same as {{=link.test1}} or
{{=link[test1]}} as in this example
response.topMenu = [dict(test1='test11', test2='test22')]
{{for link in response.topMenu:}}
{{=link.test1}} or {{=link[test1]}}
{{pass}}
On Dec 23, 3:40 pm, "Wes James" <[email protected]> wrote:
> On Tue, Dec 23, 2008 at 1:32 PM, mike <[email protected]> wrote:
>
> > Thanks for the reply, but just to make it more difficult, what if I
> > have an array of dict objects.
>
> > ex. [dict(test1='test11', test2='test22') ,dict(test1='test11',
> > test2='test22') ,dict(test1='test11', test2='test22') ,dict
> > (test1='test11', test2='test22') ]
>
> > how to I loop through it.
>
> response.topMenu=[dict(test1='test11',
> test2='test22'),dict(test3='test33', test4='test44')]
>
> {{for item in response.topMenu:}}
> {{for link in item.keys():}}
> {{=item[link]}}
> {{pass}}
> {{pass}}
>
> -wj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---