Answer the question
In order to leave comments, you need to log in
Is it possible to get the value of a loop in another Django loop?
All the best!
Tell me, is it possible to have a cycle like this in the template:
<select name='cycle1' class='select'>
<option selected value='-'>-- Выберите --</option>
{% for i in cycle_one %}
<option value='{{ i.id }}'>{{ i.my_value }}</option>
{% endfor %}
</select>
<select name='cycle2' class='select'>
<option selected value='-'>-- Выберите --</option>
{% for i in cycle_two %}
<option value='{{ i.id }}' class='{{ i.id из цикла cycle_one }}>{{ i.my_value }}</option>
{% endfor %}
</select>
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