1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

A queryset that has had ordering removed (order_by()) can have ordering added

again later (order_by('foo')). Or, at least, it can now. Thanks to Ilya
Novoselov for diagnosing the problem here.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-10-08 09:45:27 +00:00
parent 44f228fd61
commit 559aca7d78
2 changed files with 7 additions and 1 deletions

View File

@@ -608,7 +608,7 @@ class Query(object):
if self.extra_order_by:
ordering = self.extra_order_by
elif not self.default_ordering:
ordering = []
ordering = self.order_by
else:
ordering = self.order_by or self.model._meta.ordering
qn = self.quote_name_unless_alias