summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-23 13:34:03 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-10-23 13:34:03 +0000
commit3940277792a33774bb17c622cdd753deb3ee17c6 (patch)
treeb866a79bc647b82d689d5503f7e00ca320c0a572 /django
parent5e1a54a3a8285912fed02b2121b53d13fa1061fd (diff)
queryset-refactor: Fixed an order_by() regression. It must override any
existing ordering, not append to it. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6599 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/models/query.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index c36a68f404..6a6fd82b18 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -303,6 +303,7 @@ class _QuerySet(object):
assert self.query.can_filter(), \
"Cannot reorder a query once a slice has been taken."
obj = self._clone()
+ obj.query.clear_ordering()
obj.query.add_ordering(*field_names)
return obj