Opened 17 years ago

Closed 17 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: no UI/UX: no

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 by Shane R. Spencer <shane@…>, 17 years ago

Keywords: forloop added; number removed

comment:2 by Matt McClanahan, 17 years ago

Resolution: wontfix
Status: newclosed

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