is_in
I know in Django 1.2 we may acquire the same result using {% if value in arg %} but I need this filter in Django 1.1.
- template
- filter
- django
- contains
- in
- is
I know in Django 1.2 we may acquire the same result using {% if value in arg %} but I need this filter in Django 1.1.
which you would use like this: The item is {% if item|in_list:list %} in list {% else %} not in list {% endif %}
Given an item and a list, check if the item is in the list ----- item = 'a' list = [1, 'b', 'a', 4] ----- {% ifinlist item list %} Yup, it's in the list {% else %} Nope, it's not in the list {% endifinlist %}
3 snippets posted so far.