Fixed #28497 -- Restored the ability to use sliced QuerySets with __exact.

Regression in ec50937bcb.

Thanks Simon Charette for review.
This commit is contained in:
Tim Graham 2017-10-16 11:10:21 -04:00
parent 61a6245dc5
commit 1b73ccc4bf
3 changed files with 39 additions and 0 deletions

View file

@ -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.