How To Loop Dictionary With Multiple Values In Jinja?
I have a dictionary like so: {'a': [Object, 0], 'b': [Object, 1] } Where object is an actual object with multiple attributes. I'm trying to a check on each key to see if the second
Solution 1:
Use iteritems
to iterate through your dictionary:
{% for key, value in follower_list.items %}
{% if value.1 == 0 %}
<p>Hello</p>
{% else %}
<p>Goodbye</p>
{% endfor %}
Check this docs.
Post a Comment for "How To Loop Dictionary With Multiple Values In Jinja?"