From 51d101b57355b0c593f07094c20f949e5107ebd0 Mon Sep 17 00:00:00 2001 From: Ian Kelly Date: Mon, 13 Oct 2008 19:38:18 +0000 Subject: [PATCH] Fixed Oracle introspection mapping of DATE columns, and added an entry for Oracle 10g native float columns. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9231 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/oracle/introspection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py index 890e30a694..59f9779390 100644 --- a/django/db/backends/oracle/introspection.py +++ b/django/db/backends/oracle/introspection.py @@ -8,7 +8,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type objects to Django Field types. data_types_reverse = { cx_Oracle.CLOB: 'TextField', - cx_Oracle.DATETIME: 'DateTimeField', + cx_Oracle.DATETIME: 'DateField', cx_Oracle.FIXED_CHAR: 'CharField', cx_Oracle.NCLOB: 'TextField', cx_Oracle.NUMBER: 'DecimalField', @@ -16,6 +16,11 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): cx_Oracle.TIMESTAMP: 'DateTimeField', } + try: + data_types_reverse[cx_Oracle.NATIVE_FLOAT] = 'FloatField' + except AttributeError: + pass + def get_table_list(self, cursor): "Returns a list of table names in the current database." cursor.execute("SELECT TABLE_NAME FROM USER_TABLES")