summaryrefslogtreecommitdiff
path: root/django/db/models/query.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/query.py')
-rw-r--r--django/db/models/query.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index ab85bdc348..84af1bec60 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -320,6 +320,8 @@ class QuerySet(object):
keyword arguments.
"""
clone = self.filter(*args, **kwargs)
+ if self.query.can_filter():
+ clone = clone.order_by()
num = len(clone)
if num == 1:
return clone._result_cache[0]