Index: ./django/template/defaulttags.py =================================================================== --- ./django/template/defaulttags.py (revision 7947) +++ ./django/template/defaulttags.py (working copy) @@ -270,6 +270,9 @@ return '' # List of dictionaries in the format: # {'grouper': 'key', 'list': [list of contents]}. + + obj_list = sorted(obj_list, key=lambda x: x[key]) + context[self.var_name] = [ {'grouper': key, 'list': list(val)} for key, val in