summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-09-29 23:34:29 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-09-29 23:34:29 +0000
commit27b1f69d79787af2c2db35b4d2a96784a59d39a7 (patch)
treedb432f2a872cc4d9034c6afd7e1e7e62b11823fd /docs
parent151b44c89a6c53bc5e312fd84afeedffb23a0e94 (diff)
Fixed #295 - added {{{forloop.revcounter}}} and {{{forloop.revcounter0}}} variables to for loops. Also updated the docs and added unit tests to verify correct behavior. Thanks, Clint.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@736 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/templates.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/templates.txt b/docs/templates.txt
index 09431c1dda..a6848a9638 100644
--- a/docs/templates.txt
+++ b/docs/templates.txt
@@ -376,6 +376,10 @@ Built-in tag reference
========================== ================================================
``forloop.counter`` The current iteration of the loop (1-indexed)
``forloop.counter0`` The current iteration of the loop (0-indexed)
+ ``forloop.revcounter`` The number of iterations from the end of the
+ loop (1-indexed)
+ ``forloop.revcounter0`` The number of iterations from the end of the
+ loop (0-indexed)
``forloop.first`` True if this is the first time through the loop
``forloop.last`` True if this is the last time through the loop
``forloop.parentloop`` For nested loops, this is the loop "above" the