Ticket #7036: oracle_resolve_columns_fix.patch

File oracle_resolve_columns_fix.patch, 1.2 KB (added by jbronn, 17 years ago)

Fix for OracleQuery.resolve_columns due to changes in #7340.

  • django/db/backends/oracle/query.py

     
    2828        def resolve_columns(self, row, fields=()):
    2929            from django.db.models.fields import DateField, DateTimeField, \
    3030                 TimeField, BooleanField, NullBooleanField, DecimalField, Field
     31            index_start = len(self.extra_select.keys())
    3132            values = []
    32             for value, field in map(None, row, fields):
     33            for value, field in map(None, row[index_start:], fields):
    3334                if isinstance(value, Database.LOB):
    3435                    value = value.read()
    3536                # Oracle stores empty strings as null. We need to undo this in
     
    111112            # not get the attribute on the returned models.
    112113            self.extra_select['rn'] = 'ROW_NUMBER() OVER (ORDER BY %s )' % rn_orderby
    113114            sql, params= super(OracleQuery, self).as_sql(with_limits=False)
    114             self.extra_select.pop('rn')
    115115
    116116            # Constructing the result SQL, using the initial select SQL
    117117            # obtained above.
Back to Top