Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed Oracle introspection mapping of DATE columns, and added an

entry for Oracle 10g native float columns.

Backport of r9231 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4537f33487d265c78827e2f3d3b69f0074a7fda1 1 parent 743019f
Ian Kelly authored October 13, 2008
7  django/db/backends/oracle/introspection.py
@@ -8,7 +8,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
8 8
     # Maps type objects to Django Field types.
9 9
     data_types_reverse = {
10 10
         cx_Oracle.CLOB: 'TextField',
11  
-        cx_Oracle.DATETIME: 'DateTimeField',
  11
+        cx_Oracle.DATETIME: 'DateField',
12 12
         cx_Oracle.FIXED_CHAR: 'CharField',
13 13
         cx_Oracle.NCLOB: 'TextField',
14 14
         cx_Oracle.NUMBER: 'DecimalField',
@@ -16,6 +16,11 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
16 16
         cx_Oracle.TIMESTAMP: 'DateTimeField',
17 17
     }
18 18
 
  19
+    try:
  20
+        data_types_reverse[cx_Oracle.NATIVE_FLOAT] = 'FloatField'
  21
+    except AttributeError:
  22
+        pass
  23
+
19 24
     def get_table_list(self, cursor):
20 25
         "Returns a list of table names in the current database."
21 26
         cursor.execute("SELECT TABLE_NAME FROM USER_TABLES")

0 notes on commit 4537f33

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