Is it possible?
I know about filters, but is it possible to create something like this:
{% if 75 is_divisible_by 5 %}
It just looks a lot nicer than:
{% if 75|is_divisible_by:5 %}
(this is a concept question, is_divisible_by is just an example)
No, there isn’t a way to do what you are asking.
(Caution: tangential) If however you only wanted to render the value of
is_divisible_by 75 5you could define a custom template tag. Something like this:This could then be used in a template like this:
Of course this will only print
Truewhich is not what you need. I couldn’t find a way of combining this with anifcondition. Perhaps someone with better template tag fu can tell us how to do it.