from django import template
register = template.Library()

@register.filter
def is_in(item, list):

    """Returns a boolean if a given value is member of a list
    Usage::

        {% if user|is_in:list %}
        ...
        {% endif %}

    """
    return bool(item in list.all())


