mirror of https://github.com/django/django.git
Fixed incorrect variable name in {% regroup %} docs.
This commit is contained in:
parent
47f57d6776
commit
7968bb7fad
|
@ -842,8 +842,8 @@ output (as a string) inside a variable. This is useful if you want to use
|
||||||
|
|
||||||
Regroups a list of alike objects by a common attribute.
|
Regroups a list of alike objects by a common attribute.
|
||||||
|
|
||||||
This complex tag is best illustrated by way of an example: say that "places" is
|
This complex tag is best illustrated by way of an example: say that ``cities``
|
||||||
a list of cities represented by dictionaries containing ``"name"``,
|
is a list of cities represented by dictionaries containing ``"name"``,
|
||||||
``"population"``, and ``"country"`` keys:
|
``"population"``, and ``"country"`` keys:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
@ -882,8 +882,8 @@ The following snippet of template code would accomplish this::
|
||||||
{% for country in country_list %}
|
{% for country in country_list %}
|
||||||
<li>{{ country.grouper }}
|
<li>{{ country.grouper }}
|
||||||
<ul>
|
<ul>
|
||||||
{% for item in country.list %}
|
{% for city in country.list %}
|
||||||
<li>{{ item.name }}: {{ item.population }}</li>
|
<li>{{ city.name }}: {{ city.population }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue