Skip to content

Instantly share code, notes, and snippets.

@mertcangokgoz
Created November 12, 2020 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mertcangokgoz/614b06de5e9676abe8891876d890f8de to your computer and use it in GitHub Desktop.
Save mertcangokgoz/614b06de5e9676abe8891876d890f8de to your computer and use it in GitHub Desktop.
Django template check value and clear
@register.filter
def clear(value, arg):
value = str(value)
for i in arg.split(","):
value = value.replace(i, " ")
return value
@register.filter
def is_list(value):
return type(value) == type(list())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment