With Jinja2, how can I make an iteration like the folllowing which works with django and not Jinja:
{% for key,value in location_map_india.items %}
{{value.name}}
{% endfor %}
The above is valid django but with Jinja2 it returns an error message
TypeError: 'builtin_function_or_method' object is not iterable
Thanks for any advice
In Jinja2, functions and methods must be explicitly called.
{% for key,value in location_map_india.items() %}
{{value.name}}
{% endfor %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With