Ticket #7036: oracle_resolve_columns_fix.patch
File oracle_resolve_columns_fix.patch, 1.2 KB (added by , 17 years ago) |
---|
-
django/db/backends/oracle/query.py
28 28 def resolve_columns(self, row, fields=()): 29 29 from django.db.models.fields import DateField, DateTimeField, \ 30 30 TimeField, BooleanField, NullBooleanField, DecimalField, Field 31 index_start = len(self.extra_select.keys()) 31 32 values = [] 32 for value, field in map(None, row , fields):33 for value, field in map(None, row[index_start:], fields): 33 34 if isinstance(value, Database.LOB): 34 35 value = value.read() 35 36 # Oracle stores empty strings as null. We need to undo this in … … 111 112 # not get the attribute on the returned models. 112 113 self.extra_select['rn'] = 'ROW_NUMBER() OVER (ORDER BY %s )' % rn_orderby 113 114 sql, params= super(OracleQuery, self).as_sql(with_limits=False) 114 self.extra_select.pop('rn')115 115 116 116 # Constructing the result SQL, using the initial select SQL 117 117 # obtained above.