mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
newforms-admin: Fixed #7094 -- Fixed admin ordering breakage after the queryset-refactor changes from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7481 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
be9f09539c
commit
be4e86943e
@ -295,8 +295,12 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
Returns a QuerySet of all model instances that can be edited by the
|
Returns a QuerySet of all model instances that can be edited by the
|
||||||
admin site. This is used by changelist_view.
|
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 ;)
|
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):
|
def get_fieldsets(self, request, obj=None):
|
||||||
"Hook for specifying fieldsets for the add form."
|
"Hook for specifying fieldsets for the add form."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user