Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Brian Rosner authored April 27, 2008

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  django/contrib/admin/options.py
6  django/contrib/admin/options.py
@@ -295,8 +295,12 @@ def queryset(self, request):
295 295
         Returns a QuerySet of all model instances that can be edited by the
296 296
         admin site. This is used by changelist_view.
297 297
         """
  298
+        qs = self.model._default_manager.get_query_set()
  299
+        # TODO: this should be handled by some parameter to the ChangeList.
298 300
         ordering = self.ordering or () # otherwise we might try to *None, which is bad ;)
299  
-        return self.model._default_manager.get_query_set().order_by(*ordering)
  301
+        if ordering:
  302
+            qs.order_by(*ordering)
  303
+        return qs
300 304
 
301 305
     def get_fieldsets(self, request, obj=None):
302 306
         "Hook for specifying fieldsets for the add form."

0 notes on commit be4e869

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