Hi,

Quoting ticket 5908 <https://code.djangoproject.com/ticket/5908>:

"Under the following example, I would expect the cycle tag's internal 
counter to be reset after leaving the inner loop. That way it'd be 'nesting 
safe' :-) 

{% for group in grouped %}
  {% for item in group.list %}
   ... {% cycle row1,row2,row3 %} ...
  {% endfor %}
{% endfor %}

"
Actually, the current behaviour is not to reset between loops. Is that 
intentional? 

A patch to ticket 5908 <https://code.djangoproject.com/ticket/5908> adds a 
reset_cycle tag, which resets the cycle-loop. I am wondering if it is the 
right way to solve this problem, or whether it would be better to modify 
cycle's current behaviour to reset the loop after each endfor; or maybe if 
we want another kind of cycle which allows for setting both options?

What do you think? 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/ijbkyiGiKykJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to