diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-01 01:35:36 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-03-01 01:35:36 +0000 |
| commit | 283c89e4c61fa99dfdf6688a12ed3ce5a3945347 (patch) | |
| tree | 455aab0e8764d7f98e8e3af30896ecdac43e25fc /django/db/models/sql/query.py | |
| parent | 9b5b2ee2f3f64bdd71faf7631498d0892a7dbba2 (diff) | |
[1.0.X] Fixed #10202 -- Fixed another couple of slicing edge-cases with querysets.
Patch from Alex Gaynor and Ramiro Morales.
Backport of r9924 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9925 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index bb4ce92f43..0a9092d77d 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -240,7 +240,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 @@ -1534,7 +1534,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): """ |
