0

I have a dictionary in views.py in these form

{key1:[item1,item2],key2:[item1,item2]}

key1 is of type integer. It is displayed as 1000L.

Now when I'm working on the html, I have another dictionary let's say temp whose keys are the same users.

I'm doing this:

{% for k,v in temp.items %}
 <tr>   
    {% if k in render %}
       {{ k }} : {{ render.k }}
    {% endif %}
 </tr>
{% endfor %}

The key 'k' is displayed but render.k is not. If I do render.1000 then the values are displayed. Can somebody help?

karthikr
  • 97,368
  • 26
  • 197
  • 188
gizgok
  • 7,303
  • 21
  • 79
  • 124
  • Related: http://stackoverflow.com/questions/8000022/django-template-how-to-lookup-a-dictionary-value-with-a-variable – Jon Clements Jun 25 '13 at 17:57
  • The linked question answers yours perfectly. This is not possible in plain Django templates by default in any case. – Wolph Jun 25 '13 at 18:11

0 Answers0