Login

Snippets by wilfred

Snippet List

Django cycle tag that doesn't continue where it left off

This tag is equivalent to {% cycle %} but resets when we exit the containing loop. See Django ticket "Cycle tag should reset after it steps out of scope" [https://code.djangoproject.com/ticket/5908](https://code.djangoproject.com/ticket/5908) This code is a lightly modified version of Simon Litchfield's attachment on that ticket.

  • forloop
  • cycle
Read More

wilfred has posted 2 snippets.