Skip to content

Commit

Permalink
newforms-admin: Fixed #7094 -- Fixed admin ordering breakage after th…
Browse files Browse the repository at this point in the history
…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
brosner committed Apr 27, 2008
1 parent be9f095 commit be4e869
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion django/contrib/admin/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit be4e869

Please sign in to comment.