How to test for a List in Jinja2?
I did it like this:
{% if var is iterable and (var is not string and var is not mapping) %}
You can find a list of all jinja tests here.
You can easily do this whit a custom filter in jinja2.
First create you test method:
def is_list(value):
return isinstance(value, list)
And add it as an custom filter:
j = jinja2.Jinja2(app)
j.environment.filters.update({
'is_list': is_list,
})