Ticket #9928: 9928.diff
File 9928.diff, 2.1 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/sites.py
12 12 from django.views.decorators.cache import never_cache 13 13 from django.conf import settings 14 14 from django.utils.hashcompat import md5_constructor 15 from django.utils.datastructures import SortedDict 15 16 16 17 ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.") 17 18 LOGIN_FORM_KEY = 'this_is_the_login_form' … … 35 36 app_index_template = None 36 37 37 38 def __init__(self): 38 self._registry = {}# model_class class -> admin_class instance39 self._registry = SortedDict({}) # model_class class -> admin_class instance 39 40 40 41 def register(self, model_or_iterable, admin_class=None, **options): 41 42 """ … … 304 305 app_list = app_dict.values() 305 306 app_list.sort(lambda x, y: cmp(x['name'], y['name'])) 306 307 307 # Sort the models alphabetically within each app.308 for app in app_list:309 app['models'].sort(lambda x, y: cmp(x['name'], y['name']))310 311 308 context = { 312 309 'title': _('Site administration'), 313 310 'app_list': app_list, -
django/contrib/databrowse/sites.py
3 3 from django.contrib.databrowse.datastructures import EasyModel 4 4 from django.shortcuts import render_to_response 5 5 from django.utils.safestring import mark_safe 6 from django.utils.datastructures import SortedDict 6 7 7 8 class AlreadyRegistered(Exception): 8 9 pass … … 70 71 71 72 class DatabrowseSite(object): 72 73 def __init__(self): 73 self.registry = {}# model_class -> databrowse_class74 self.registry = SortedDict({}) # model_class -> databrowse_class 74 75 self.root_url = None 75 76 76 77 def register(self, model_or_iterable, databrowse_class=None, **options):