Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to pass two arg django filters

#It is more simple than you think
#You can use simple_tag for this.
from django import template
register = template.Library()

@register.simple_tag
def multiple_args_tag(a, b, c, d):
   #do your stuff
   return

#In Template
{% multiple_args_tag 'arg1' 'arg2' 'arg3' 'arg4' %}

# courtesy: sof
# https://stackoverflow.com/questions/420703/how-do-i-add-multiple-arguments-to-my-custom-template-filter-in-a-django-templat 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pass #arg #django #filters
ADD COMMENT
Topic
Name
5+5 =