views:

48

answers:

2

Hi,

I don't really know how to describe what I'm aiming at (EDIT: I want a dynamic attribute lookup), but I'm trying to do something like this <p>{{dict.{{object.field}}}}</p> in a template. I also tried:

{% with object.field as field %}
     {{dict.field}}
{% endwith %}

wich didn't work either. Do you know how to tackle this properly?

Thanks in advance!

A: 

To loop through a dictionary you use "for":

{% for dictionary.object as obj %}
    {{ obj.field }}
{% endfor %}
markmywords
+1  A: 

See this SO question.

PiotrLegnica