Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

queryset-refactor: Fixed db column to model field mapping for Oracle …

…backend.

Thanks, Justin Bronn. Fixed #7036.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7438 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c43a3d78b1a7c65b903922679c76a499e484dea5 1 parent d4956cb
Malcolm Tredinnick authored April 20, 2008

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/db/backends/oracle/query.py
4  django/db/backends/oracle/query.py
@@ -28,8 +28,9 @@ class OracleQuery(QueryClass):
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,7 +112,6 @@ def as_sql(self, with_limits=True):
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.

0 notes on commit c43a3d7

Please sign in to comment.
Something went wrong with that request. Please try again.