From 1b73ccc4bf78af905f72f4658cf463f38ebf7b97 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 16 Oct 2017 11:10:21 -0400 Subject: Fixed #28497 -- Restored the ability to use sliced QuerySets with __exact. Regression in ec50937bcbe160e658ef881021402e156beb0eaf. Thanks Simon Charette for review. --- django/db/models/sql/query.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'django/db/models/sql') 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. -- cgit v1.3