#7863: More info on template tag "regroup" (needs a sorted list)
------------------------------------+---------------------------------------
Reporter: jedie | Owner: nobody
Status: new | Milestone:
Component: Documentation | Version: SVN
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by jedie):
* needs_better_patch: => 0
* summary: template tag "regroup" needs a sorted list... => More info on
template tag "regroup" (needs a sorted list)
* component: Template system => Documentation
* needs_tests: => 0
* needs_docs: => 0
Comment:
OK, now i see in the sourcecode ./django/template/defaulttags.py this:
{{{
Note that `{% regroup %}`` does not work when the list to be grouped
is not
sorted by the key you are grouping by! This means that if your list
of
people was not sorted by gender, you'd need to make sure it is sorted
before using it, i.e.::
{% regroup people|dictsort:"gender" by gender as grouped %}
}}}
IMHO this should be added to the docu:
http://www.djangoproject.com/documentation/templates/#regroup
--
Ticket URL: <http://code.djangoproject.com/ticket/7863#comment:1>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---