Ticket #7863: defaulttags_patch.txt
File defaulttags_patch.txt, 539 bytes (added by , 16 years ago) |
---|
Line | |
---|---|
1 | Index: ./django/template/defaulttags.py |
2 | =================================================================== |
3 | --- ./django/template/defaulttags.py (revision 7947) |
4 | +++ ./django/template/defaulttags.py (working copy) |
5 | @@ -270,6 +270,9 @@ |
6 | return '' |
7 | # List of dictionaries in the format: |
8 | # {'grouper': 'key', 'list': [list of contents]}. |
9 | + |
10 | + obj_list = sorted(obj_list, key=lambda x: x[key]) |
11 | + |
12 | context[self.var_name] = [ |
13 | {'grouper': key, 'list': list(val)} |
14 | for key, val in |