Jinja Compat Tests

Enabled engines

rejectattr filter

Template

{% for item in items|rejectattr('id', 'odd') %}
{{ item.name }}
{% endfor %}

Data

{
  "items": [
    { "id": 1, "name": "alpha" },
    { "id": 2, "name": "bravo" },
    { "id": 3, "name": "delta" }
  ]
}

(error) v1.10.1

'for' statements should use the format 'for x in y': for item in items|rejectattr('id', 'odd')

v2.8.0


bravo

v3.0.6


alpha

bravo

delta

(error) v2.5.0

(no output)

(error) v1.4.2

Invalid filter "rejectattr".

(error) v1.24.2

Unknown "rejectattr" filter.

(error) v0.9.5

Unable to find filter rejectattr

Template

{% for item in items|rejectattr('is_selected') %}
{{ item.name }}
{% endfor %}

Data

{
  "items": [
    { "name": "alpha", "is_selected": false },
    { "name": "bravo", "is_selected": true },
    { "name": "delta", "is_selected": true }
  ]
}

(error) v1.10.1

Invalid filter: 'rejectattr'

v2.8.0


alpha

v3.0.6


alpha

bravo

delta

v2.5.0


alpha

(error) v1.4.2

Invalid filter "rejectattr".

(error) v1.24.2

Unknown "rejectattr" filter.

(error) v0.9.5

Unable to find filter rejectattr