]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Add in docs/switching/#loops little improvement for consistency 1694/head
authorSébastien DIDIER <73602526+sdidier-dev@users.noreply.github.com>
Fri, 22 Jul 2022 15:47:56 +0000 (17:47 +0200)
committerSébastien DIDIER <73602526+sdidier-dev@users.noreply.github.com>
Fri, 22 Jul 2022 15:47:56 +0000 (17:47 +0200)
docs/switching.rst

index caa35c36821cd8a0cc9e4b8368286a578d4021d9..a0ee530e7510f2740e8a45cea6999a62fa65ac0a 100644 (file)
@@ -84,7 +84,7 @@ In Django, the special variable for the loop context is called
 .. code-block:: django
 
     {% for item in items %}
-        {{ item }}
+        {{ forloop.counter }}. {{ item }}
     {% empty %}
         No items!
     {% endfor %}
@@ -95,7 +95,7 @@ and the ``else`` block is used for no loop items.
 .. code-block:: jinja
 
     {% for item in items %}
-        {{ loop.index}}. {{ item }}
+        {{ loop.index }}. {{ item }}
     {% else %}
         No items!
     {% endfor %}