Login

Tag "in"

Snippet List

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
Read More

in_list filter

which you would use like this: The item is {% if item|in_list:list %} in list {% else %} not in list {% endif %}

  • template
  • filter
  • lists
  • tag
  • contains
  • in
Read More

If in list template tag

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 %}

  • template
  • tag
  • list
  • in
Read More

3 snippets posted so far.