Commits

Mark Finger  committed 08fd5a5
  • Participants
  • Parent commits 8bcc0fb

Comments (0)

Files changed (2)

File admin_tools/dashboard/modules.py

         apps_sorted = apps.keys()
         apps_sorted.sort()
         for app in apps_sorted:
-            # sort model list alphabetically
-            apps[app]['models'].sort(lambda x, y: cmp(x['title'], y['title']))
             self.children.append(apps[app])
         self._initialized = True
 

File admin_tools/utils.py

         included = items
     else:
         for pattern in models:
+            pattern_items = []
             for item in items:
                 model, perms = item
                 if fnmatch(full_name(model), pattern) and item not in included:
-                    included.append(item)
-
+                    pattern_items.append(item)
+            pattern_items.sort(key=lambda x:x[0]._meta.verbose_name_plural)
+            included.extend(pattern_items)
+    
     result = included[:]
     for pattern in exclude:
         for item in included: