summaryrefslogtreecommitdiff
path: root/django/contrib/admin/sites.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/admin/sites.py')
-rw-r--r--django/contrib/admin/sites.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index 4446490451..d0d6473a34 100644
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -379,11 +379,11 @@ class AdminSite(object):
# Sort the apps alphabetically.
app_list = app_dict.values()
- app_list.sort(lambda x, y: cmp(x['name'], y['name']))
+ app_list.sort(key=lambda x: x['name'])
# Sort the models alphabetically within each app.
for app in app_list:
- app['models'].sort(lambda x, y: cmp(x['name'], y['name']))
+ app['models'].sort(key=lambda x: x['name'])
context = {
'title': _('Site administration'),
@@ -443,7 +443,7 @@ class AdminSite(object):
if not app_dict:
raise http.Http404('The requested admin page does not exist.')
# Sort the models alphabetically within each app.
- app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
+ app_dict['models'].sort(key=lambda x: x['name'])
context = {
'title': _('%s administration') % capfirst(app_label),
'app_list': [app_dict],