python - How to access all dictionary keys in template -
i passing dictionary below template:
mydict={6:"a",9:"b"}
now want check in template if particular value in dictionary key.something like:
{% if in mydict.items.keys %} ok {% endif %}
i want display "ok" if either 6 or 9, above syntax not work.
thanks.
check without using items.keys, just
{% if in mydict %} ok {% endif %}
or, if want use keys
{% if in mydict.keys %} ok {% endif %}
Comments
Post a Comment