Reputation: 423
i need to pass from view to view using Balise in django template, so i have a dictionary contained my arguments this the code i used in my template
{% for item in data % }
{% for key, value in item.items %}
{% if key == '13' %}<a href="{% url hisaccount value %}">{% endif %}<p>go to view</p></a>
{% endfor %}
{% endfor %}
but i get this error :
NoReverseMatch at /filter/
Reverse for '' with arguments '(1,)' and keyword arguments '{}' not found.
any suggestion ?
Upvotes: 1
Views: 1119
Reputation: 3593
I needed to do something similar. After some digging, it looks like its not built in as a default Django template tag.
You need to build your own, I used this one that I've found on stackoverflow: Django template how to look up a dictionary value with a variable
Upvotes: 1