In Jinja2 I'm looking for a way to check if at least one of a list of variables has a value. Basically in python I would do:
if any([item['genre'], item['type'], item['color']]):
However, in Jinja the following isn't valid:
{% if any([item['genre'], item['type'], item['color']]) %}
# some part of the Jinja template
{% endif %}
Is there a way to have the same "any()" check in Jinja2?
For background: the full piece of code that I currently try to add (but isn't valid):
{% if any([item['genre'], item['type'], item['color']]) %}
<ItemProperties>
<ItemProperty key="genre">{{ item['genre'] }}</ItemProperty>
<ItemProperty key="type">{{ item['type'] }}</ItemProperty>
<ItemProperty key="color">{{ item['color'] }}</ItemProperty>
</ItemProperties>
{% endif %}