Is it possible to create a Django template tag that computes a boolean?
For example, can I do:
{% if my_custom_tag %} .. {% else %} .. {% endif %}
At the moment, I wrote it as a tag that works fine as follows:
{% my_custom_tag as var_storing_result %}
But I was just curious if I could do it differently, because I think it would be better if I didn't have to assign the result to the variable first.
Thanks!
Ludo
source share