Opened 8 years ago

Closed 8 years ago

#6469 closed (wontfix)

add 'even' to forloop in template/defaulttags.py

Reported by: shane@… Owned by: nobody
Component: Template system Version: 0.96
Severity: Keywords: even, forloop
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

It would be nice to know when a counter is even or not

--- template/defaulttags.py 2007-10-26 11:21:36.000000000 -0800
+++ /tmp/defaulttags.py 2008-01-26 10:46:06.000000000 -0900
@@ -115,6 +115,7 @@

# boolean values designating first and last times through loop
'first': (i == 0),
'last': (i == len_values - 1),

+ 'even': (i % 2 == 0)

'parentloop': parentloop,

}
context[self.loopvar] = item

Change History (2)

comment:1 Changed 8 years ago by Shane R. Spencer <shane@…>

  • Keywords forloop added; number removed
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 8 years ago by mattmcc

  • Resolution set to wontfix
  • Status changed from new to closed

There are a handful of options for this, such as the cycle tag and the divisibleby filter.

Note: See TracTickets for help on using tickets.
Back to Top