Created
February 11, 2018 06:16
-
-
Save bkawan/9a142d18f55587df85e76e34e00e7481 to your computer and use it in GitHub Desktop.
Django multiple filter at once.
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
https://micropyramid.com/blog/django-custom-template-tags-and-filters/ | |
@register.filter(name='one_more') | |
def another_filter(value_1, value_2): | |
return value_1.upper(), value_2.lower() | |
@register.filter() | |
def custom_filter(another_filter_value, value_3): | |
value_1, value_2 = another_filter_value | |
print "now you have three arguments, enjoy" | |
return value1, value2, value3 | |
{{ 'value1'|another_filter:'value2'|custom_filter:'value3' }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment