summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-23 01:34:49 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-23 01:34:49 +0000
commit7355fa6b728357a3e7257fbe1175d68a0d7e2ec1 (patch)
tree04f384b99607f4dd9e7ef94d1d2399dcfdbc891f /django/db/models/sql
parente2f524ca09bacef4545b56dc3f136655fa0b912c (diff)
queryset-refactor: Implemented slicing to end of querysets.
Refs #2150, #5012. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7147 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/query.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 20dcb4b71d..f251730c48 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -262,11 +262,15 @@ 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:
result.append('LIMIT %d' % (self.high_mark - self.low_mark))
if self.low_mark:
- assert self.high_mark, "'offset' is not allowed without 'limit'"
+ if not self.high_mark:
+ val = self.connection.ops.no_limit_value()
+ if val:
+ result.append('LIMIT %d' % val)
result.append('OFFSET %d' % self.low_mark)
params.extend(self.extra_params)