templetor for loops need odd and even functions like django
Bug #176751 reported by
Aaron Swartz
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web.py |
Fix Released
|
High
|
Anand Chitipothu |
Bug Description
There should be some way to get the n of a for loop and whether it's odd or even. I'm thinking something like:
$for r in rows:
<tr class="
The variables available this way would ideally be:
$for.n: the iteration of the loop (1-indexed)
$for.n0: the iteration of the loop (0-indexed)
$for.first: True if first iteration
$for.last: True if last iteration
$for.odd: True if an odd iteration
$for.even: True if an even iteration
$for.parity: "odd" or "even" depending on which is true
$for.parent: the loop above this in nested loops
Changed in webpy: | |
status: | In Progress → Fix Committed |
Changed in webpy: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
i can probably work on this if you can't do it