Ticket #10734: actions-sorted.diff

File actions-sorted.diff, 974 bytes (added by Alex Gaynor, 16 years ago)
  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index 7cb1aac..9b3b677 100644
    a b from django.utils.text import capfirst, get_text_list  
    1919from django.utils.translation import ugettext as _
    2020from django.utils.translation import ngettext, ugettext_lazy
    2121from django.utils.encoding import force_unicode
     22from django.utils.datastructures import SortedDict
    2223try:
    2324    set
    2425except NameError:
    class ModelAdmin(BaseModelAdmin):  
    419420        Return a dictionary mapping the names of all actions for this
    420421        ModelAdmin to a tuple of (callable, name, description) for each action.
    421422        """
    422         actions = {}
     423        actions = SortedDict()
    423424        for klass in [self.admin_site] + self.__class__.mro()[::-1]:
    424425            for action in getattr(klass, 'actions', []):
    425426                func, name, description = self.get_action(action)
Back to Top