5👍
✅
You could use the with
template tag.
{% with var=query.id %}
... use var in this template scope
{% endwith %}
You could also create your own template tag.
Source:stackexchange.com