1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #10202 -- Fixed another couple of slicing edge-cases with querysets.

Patch from Alex Gaynor and Ramiro Morales.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9924 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2009-03-01 01:24:03 +00:00
parent 5fcd75ce14
commit bbea457fbb
2 changed files with 9 additions and 3 deletions

View File

@@ -345,7 +345,7 @@ class BaseQuery(object):
# in SQL (in variants that provide them) doesn't change the COUNT
# output.
number = max(0, number - self.low_mark)
if self.high_mark:
if self.high_mark is not None:
number = min(number, self.high_mark - self.low_mark)
return number
@@ -1760,7 +1760,7 @@ class BaseQuery(object):
Typically, this means no limits or offsets have been put on the results.
"""
return not (self.low_mark or self.high_mark)
return not self.low_mark and self.high_mark is None
def clear_select_fields(self):
"""