Answer the question
In order to leave comments, you need to log in
How to get another array element with current iteration in django template loop?
There is a template in which q_t and q_p are passed, they contain the same number of elements:
{% for q in q_t.all %}
<div class="row">
<div class="col-md-8">
{{q.q_text}}
</div>
<div class="col-md-4">
<a href="#">{{ q_p.{{forloop.counter0}}}}</a>
</div>
</div>
<br>
{% endfor %}
<a href="#">{{q_p.{{forloop.counter0}}}}</a>
<a href="#">{{q_p.forloop.counter0}}</a>
<a href="#">{{q_p}}.{{forloop.counter0}}</a>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question