Changeset 7885
- Timestamp:
- 07/11/08 07:43:27 (4 months ago)
- Files:
-
- django/trunk/django/db/models/sql/query.py (modified) (2 diffs)
- django/trunk/tests/regressiontests/queries/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/models/sql/query.py
r7835 r7885 286 286 # FIXME: Pull this out to make life easier for Oracle et al. 287 287 if with_limits: 288 if self.high_mark :288 if self.high_mark is not None: 289 289 result.append('LIMIT %d' % (self.high_mark - self.low_mark)) 290 if self.low_mark :291 if not self.high_mark:290 if self.low_mark is not None: 291 if self.high_mark is None: 292 292 val = self.connection.ops.no_limit_value() 293 293 if val: … … 1382 1382 clamped to any existing high value. 1383 1383 """ 1384 if high :1384 if high is not None: 1385 1385 if self.high_mark: 1386 1386 self.high_mark = min(self.high_mark, self.low_mark + high) 1387 1387 else: 1388 1388 self.high_mark = self.low_mark + high 1389 if low :1389 if low is not None: 1390 1390 if self.high_mark: 1391 1391 self.low_mark = min(self.high_mark, self.low_mark + low) django/trunk/tests/regressiontests/queries/models.py
r7883 r7885 811 811 [<Item: one>, <Item: two>] 812 812 813 Bug #7698 -- People like to slice with '0' as the high-water mark. 814 >>> Item.objects.all()[0:0] 815 [] 816 813 817 """} 814 818
