[Answered ]-In django, can I use 'as' in if tags like so: {% if excessively_verbose.chain_of_long.nested_references as foo%}

2👍

It sounds like what you want is something more along the lines of:

{% with foo=excessively_verbose.chain_of_long.nested_references %}
    {% if foo %}
        {{ foo }} bar
    {% endif %}
{% endwith %}

Leave a comment