Created
November 12, 2020 08:43
-
-
Save mertcangokgoz/614b06de5e9676abe8891876d890f8de to your computer and use it in GitHub Desktop.
Django template check value and clear
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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