summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-10-16 11:10:21 -0400
committerTim Graham <timograham@gmail.com>2017-10-16 13:56:38 -0400
commit1b73ccc4bf78af905f72f4658cf463f38ebf7b97 (patch)
tree5fb10a733542297ab5adbe52a04ca3ffc5f1abaa /django/db/models/sql/query.py
parent61a6245dc5c9ad8423dcceb47fdeff167c838542 (diff)
Fixed #28497 -- Restored the ability to use sliced QuerySets with __exact.
Regression in ec50937bcbe160e658ef881021402e156beb0eaf. Thanks Simon Charette for review.
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index a962aabdf1..372431c620 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1627,6 +1627,9 @@ class Query:
"""Clear any existing limits."""
self.low_mark, self.high_mark = 0, None
+ def has_limit_one(self):
+ return self.high_mark is not None and (self.high_mark - self.low_mark) == 1
+
def can_filter(self):
"""
Return True if adding filters to this instance is still possible.