List comprehensions in Jinja
Since v2.7 there is selectattr: Filters a sequence of objects by applying a test to the specified attribute of each object, and only selecting the objects with the test succeeding. If no test is specified, the attribute’s value will be evaluated as a boolean. Example usage: {{ users|selectattr(“is_active”) }} {{ users|selectattr(“email”, “none”) }} Similar to … Read more