diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2006-05-29 11:02:32 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2006-05-29 11:02:32 +0000 |
| commit | e9c8a9e136cf94168e8242013f93198eb903b16e (patch) | |
| tree | 41488efac936192a9031193d46407cfbfb68f6d9 | |
| parent | 60c3e55b1f7c87ef9fa7c5ffdaf6e8dba5ab7043 (diff) | |
Fixed #2029 - models now sorted by verbose_name_plural in get_admin_app_list - thanks Alex Dedul.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2999 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/admin/templatetags/adminapplist.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/contrib/admin/templatetags/adminapplist.py b/django/contrib/admin/templatetags/adminapplist.py index 5e544fe19f..10e09ca0b6 100644 --- a/django/contrib/admin/templatetags/adminapplist.py +++ b/django/contrib/admin/templatetags/adminapplist.py @@ -42,7 +42,12 @@ class AdminApplistNode(template.Node): }) 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, |
