Skip to content

Commit

Permalink
Fixed Oracle introspection mapping of DATE columns, and added an entr…
Browse files Browse the repository at this point in the history
…y for Oracle 10g native float columns.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
nightflyerkilo committed Oct 13, 2008
1 parent d7c829c commit 51d101b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion django/db/backends/oracle/introspection.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types. # Maps type objects to Django Field types.
data_types_reverse = { data_types_reverse = {
cx_Oracle.CLOB: 'TextField', cx_Oracle.CLOB: 'TextField',
cx_Oracle.DATETIME: 'DateTimeField', cx_Oracle.DATETIME: 'DateField',
cx_Oracle.FIXED_CHAR: 'CharField', cx_Oracle.FIXED_CHAR: 'CharField',
cx_Oracle.NCLOB: 'TextField', cx_Oracle.NCLOB: 'TextField',
cx_Oracle.NUMBER: 'DecimalField', cx_Oracle.NUMBER: 'DecimalField',
cx_Oracle.STRING: 'CharField', cx_Oracle.STRING: 'CharField',
cx_Oracle.TIMESTAMP: 'DateTimeField', cx_Oracle.TIMESTAMP: 'DateTimeField',
} }


try:
data_types_reverse[cx_Oracle.NATIVE_FLOAT] = 'FloatField'
except AttributeError:
pass

def get_table_list(self, cursor): def get_table_list(self, cursor):
"Returns a list of table names in the current database." "Returns a list of table names in the current database."
cursor.execute("SELECT TABLE_NAME FROM USER_TABLES") cursor.execute("SELECT TABLE_NAME FROM USER_TABLES")
Expand Down

0 comments on commit 51d101b

Please sign in to comment.