I am wondering if there is a way by which you can call the template tag from the instruction if.
I am trying to do the following.
{% for k,v in form.amenities.field.choices %}
{% if {% check_hidden k %} %}
{{ v }}
{% endif %}
{% endfor %}
The tag {% check_hidden k %}returns Trueor Falsefrom the table for the item being viewed. I can confirm that it {% check_hidden k %}returns either True, or False, but I wonder if I can wrap an operator around it if?
The application I'm working with is inherited, so I'm trying to minimize the number of changes that need to be done at the moment. Currently it just displays as {{form.amenities}}, but I added an extra field to the model, which I need to check before displaying the field in the template.
If there is another way to do this, I am open to suggestions.
Thanks in advance.
source
share