Как я могу получить следующий объект в цикле django for?
Я имею в виду, можно ли сделать так {{ route.segments.all.ind }}
?
{% for segment in route.segments.all %}
{% if segment.departure == departure %}
{% with forloop.counter as ind %}
<span style="margin-top: -5px; font-size: smaller">
$ {{ route.segments.all.ind }}
{{ segment.distance }}km
{{ segment.duration }}hour</span>
{%endwith %}
{% endif %}
{% endfor %}