For example, let's say there is a custom template tag
{% custom_tag "parameter" %}
This tag requires some serious database work to calculate.
Now I need to have something like that (pseudocode):
if {% custom_tag "parameter" %}
....
else
....
I know that with context variables I can do just:
{% with variable.x.y.z as v %}
{% if v %}
Blah-Blah-Blah {{ v }}
{% else %}
No value
{% endif %}
{% endwith %}
But is there any way do achieve this with template tag value?
EDIT: The only option I've came up with so far is to make a filter out of my template tag:
{% if "parameter" | custom_tag %}
Blah {{ "parameter" | custom_tag }}
{% else %}
....
{% endif %}
But this option makes custom_tag execute twice, and that's not good performance-wise