summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-02-10 20:52:52 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2013-02-10 20:58:25 +0200
commit5cc0f5f8c1f35218ee4bce2d8c943a86f1888b96 (patch)
treef600c636ffc70235477d8290ff7f4280581d361f /django/db/models/sql/query.py
parentaf2bb174708e662c59f43f3f8df79e4de7411451 (diff)
Made Query.clear_ordering force_empty arg mandatory
Previously it was possible to call clear_ordering without the force_empty argument. The result was that the query was still ordered by model's meta ordering if that was defined. By making the arg mandatory it will be easier to spot possible errors caused by assuming clear_ordering will remove all ordering. Thanks to Dylan Klomparens for the suggestion. Refs #19720.
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 613f4c4cfc..fb0f09efde 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1638,7 +1638,7 @@ class Query(object):
else:
self.default_ordering = False
- def clear_ordering(self, force_empty=False):
+ def clear_ordering(self, force_empty):
"""
Removes any ordering settings. If 'force_empty' is True, there will be
no ordering in the resulting query (not even the model's default).