function_tag
register any python function as a tag with an optional name. usage: in templatetags: @function_tag() def foo(arg): return do_something(arg) in template: {% foo arg %} or {% foo arg as variable %}{{ variable.bar }}
- tag
- function
register any python function as a tag with an optional name. usage: in templatetags: @function_tag() def foo(arg): return do_something(arg) in template: {% foo arg %} or {% foo arg as variable %}{{ variable.bar }}
tensiongyb has posted 1 snippet.