Skip to content

Commit

Permalink
Fixed #2029 - models now sorted by verbose_name_plural in get_admin_a…
Browse files Browse the repository at this point in the history
…pp_list - thanks Alex Dedul.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2999 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed May 29, 2006
1 parent 60c3e55 commit e9c8a9e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion django/contrib/admin/templatetags/adminapplist.py
Expand Up @@ -42,7 +42,12 @@ def render(self, context):
})

if model_list:
model_list.sort()
# Sort using verbose decorate-sort-undecorate pattern
# instead of key argument to sort() for python 2.3 compatibility
decorated = [(x['name'], x) for x in model_list]
decorated.sort()
model_list = [x for key, x in decorated]

app_list.append({
'name': app_label.title(),
'has_module_perms': has_module_perms,
Expand Down

0 comments on commit e9c8a9e

Please sign in to comment.