From: Sébastien DIDIER <73602526+sdidier-dev@users.noreply.github.com> Date: Fri, 22 Jul 2022 15:47:56 +0000 (+0200) Subject: Add in docs/switching/#loops little improvement for consistency X-Git-Tag: 3.1.3~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1694%2Fhead;p=thirdparty%2Fjinja.git Add in docs/switching/#loops little improvement for consistency --- diff --git a/docs/switching.rst b/docs/switching.rst index caa35c36..a0ee530e 100644 --- a/docs/switching.rst +++ b/docs/switching.rst @@ -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 %}