1 from django import template
4 Miscellaneous template tags and filters.
7 register = template.Library()
8 @register.filter(name='remove_item')
9 def remove_item(container, item):
11 Removes the given user from the filtered list or dict.
13 if (item in container):
14 if isinstance(container, list):
15 container.remove(item)
16 elif isinstance(container, dict):
20 # vim: set sts=4 sw=4 expandtab: