Changeset 7443
- Timestamp:
- 04/23/08 02:30:30 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/queryset-refactor/django/db/backends/oracle/query.py
r7438 r7443 30 30 TimeField, BooleanField, NullBooleanField, DecimalField, Field 31 31 index_start = len(self.extra_select.keys()) 32 values = []32 values = list(row[:index_start]) 33 33 for value, field in map(None, row[index_start:], fields): 34 34 if isinstance(value, Database.LOB): … … 109 109 110 110 # Getting the selection SQL and the params, which has the `rn` 111 # extra selection SQL; we pop `rn` after this completes so we do 112 # not get the attribute on the returned models. 111 # extra selection SQL. 113 112 self.extra_select['rn'] = 'ROW_NUMBER() OVER (ORDER BY %s )' % rn_orderby 114 113 sql, params= super(OracleQuery, self).as_sql(with_limits=False) … … 126 125 return ' '.join(result), params 127 126 127 def set_limits(self, low=None, high=None): 128 super(OracleQuery, self).set_limits(low, high) 129 130 # We need to select the row number for the LIMIT/OFFSET sql. 131 # A placeholder is added to extra_select now, because as_sql is 132 # too late to be modifying extra_select. However, the actual sql 133 # depends on the ordering, so that is generated in as_sql. 134 self.extra_select['rn'] = '1' 135 136 def clear_limits(self): 137 super(OracleQuery, self).clear_limits() 138 if 'rn' in self.extra_select: 139 del self.extra_select['rn'] 140 128 141 _classes[QueryClass] = OracleQuery 129 142 return OracleQuery
