summaryrefslogtreecommitdiff
path: root/django/db/models/sql/query.py
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-07-14 05:04:57 +0000
committerBrian Rosner <brosner@gmail.com>2008-07-14 05:04:57 +0000
commit2624f4ea563e8139c7f19a20d9b723d39b1e6ac1 (patch)
tree975193cb2d38ec3369e2688818d41e07660fb40a /django/db/models/sql/query.py
parentf3cda0b77afb2a6e22520b4c9f1c6d111add6ac9 (diff)
newforms-admin: Merged from trunk up to [7917].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql/query.py')
-rw-r--r--django/db/models/sql/query.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 7944d0358f..f682c71d07 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -283,12 +283,11 @@ class Query(object):
if ordering:
result.append('ORDER BY %s' % ', '.join(ordering))
- # FIXME: Pull this out to make life easier for Oracle et al.
if with_limits:
- if self.high_mark:
+ if self.high_mark is not None:
result.append('LIMIT %d' % (self.high_mark - self.low_mark))
if self.low_mark:
- if not self.high_mark:
+ if self.high_mark is None:
val = self.connection.ops.no_limit_value()
if val:
result.append('LIMIT %d' % val)
@@ -1381,12 +1380,12 @@ class Query(object):
constraints. So low is added to the current low value and both will be
clamped to any existing high value.
"""
- if high:
+ if high is not None:
if self.high_mark:
self.high_mark = min(self.high_mark, self.low_mark + high)
else:
self.high_mark = self.low_mark + high
- if low:
+ if low is not None:
if self.high_mark:
self.low_mark = min(self.high_mark, self.low_mark + low)
else: