On Fri, Jun 4, 2010 at 10:15 AM, ChuanRen <liuchuan...@gmail.com> wrote:
> for example:
> keys=[item1,item2]
> obj={item1:1,item2:2}
>
> the template:
> {%for key in keys%}
>    {{obj.key}}
> {%endfor%}
>
> In this example, the key in template will resolved to item1 and item2,
> I thought:
> {{obj.{{key}}}}
> will work, but it output a error.
>
> Any approach can solve this problem?
>

http://djangosnippets.org/snippets/1412/

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to