Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

newforms-admin: Fixed #7094 -- Fixed admin ordering breakage after th…

…e queryset-refactor changes from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7481 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit be4e86943e51a610aeac6482b22f7a93b1299776 1 parent be9f095
@brosner brosner authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/contrib/admin/options.py
View
6 django/contrib/admin/options.py
@@ -295,8 +295,12 @@ def queryset(self, request):
Returns a QuerySet of all model instances that can be edited by the
admin site. This is used by changelist_view.
"""
+ qs = self.model._default_manager.get_query_set()
+ # TODO: this should be handled by some parameter to the ChangeList.
ordering = self.ordering or () # otherwise we might try to *None, which is bad ;)
- return self.model._default_manager.get_query_set().order_by(*ordering)
+ if ordering:
+ qs.order_by(*ordering)
+ return qs
def get_fieldsets(self, request, obj=None):
"Hook for specifying fieldsets for the add form."
Please sign in to comment.
Something went wrong with that request. Please try again.