I have a tuple, such that
{{VISIBILITY_CHOICES.1.1}}
Outputs "hello".
I have model "task" with a attribute "visibility_status", and in a loop, say all the iterations of task.visibility_status outputs 1
{{task.visibility_status}}
Outputs 1.
How do I use this task.visibility_status inside the lookup of the tuple? Something like VISIBILITY_CHOICES[task.visibility_status][1] in a different language.
I'm very new to django... Thanks a lot.
edit: The code I was running:
{% for task in tasks %}
<div class="post">
<h1><a href="">{{ task.subject }}</a></h1>
<div class="date">
<p>Due: {{ task.due_date }}</p>
<p>Assigned to: {{task.assigned_to}}</p>
</div>
<p>{{ task.text_area|linebreaks }}</p>
{% with args=""|add:task.visibility_status|add:",1" %}
<p>Visibility Status: {{VISIBILITY_CHOICES|get_index:args}}({{ task.visibility_status }})</p>
{% endwith %}
<p>Case Status: {{ task.case_status }}</p>
<div class="date">
<p>Created: {{ task.created_date }} by {{ task.author }}</p>
</div>
</div>
{% endfor %}