]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
clarify groupby behavior in docs
authorRoy Revelt <roy@codsen.com>
Sat, 9 Mar 2019 11:23:39 +0000 (11:23 +0000)
committerDavid Lord <davidism@gmail.com>
Tue, 23 Jul 2019 21:49:06 +0000 (14:49 -0700)
jinja2/filters.py

index 2b45b3cca2dbea0ad3c990d4fa42dc894209a413..68f90c50fd2b2307233cce7a94af39f5f2a05023 100644 (file)
@@ -888,18 +888,18 @@ def do_groupby(environment, value, attribute):
         {% endfor %}
         </ul>
 
-    Additionally it's possible to use tuple unpacking for the grouper and
-    list:
+    Additionally it's possible to use tuple unpacking for the grouper
+    (`gender` in this example) and `list`:
 
     .. sourcecode:: html+jinja
 
         <ul>
-        {% for grouper, list in persons|groupby('gender') %}
+        {% for gender, list in persons|groupby('gender') %}
             ...
         {% endfor %}
         </ul>
 
-    As you can see the item we're grouping by is stored in the `grouper`
+    As you can see the item we're grouping by is stored in the ``gender``
     attribute and the `list` contains all the objects that have this grouper
     in common.