Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

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

…e queryset-refactor changes from trunk.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent be9f095 commit be4e86943e51a610aeac6482b22f7a93b1299776 @brosner brosner committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/contrib/admin/
6 django/contrib/admin/
@@ -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."

0 comments on commit be4e869

Please sign in to comment.
Something went wrong with that request. Please try again.