summaryrefslogtreecommitdiff
path: root/django/db/backends/oracle/introspection.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/oracle/introspection.py')
-rw-r--r--django/db/backends/oracle/introspection.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py
index 543e84a8f3..0b4f61a360 100644
--- a/django/db/backends/oracle/introspection.py
+++ b/django/db/backends/oracle/introspection.py
@@ -26,6 +26,14 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
except AttributeError:
pass
+ def get_field_type(self, data_type, description):
+ # If it's a NUMBER with scale == 0, consider it an IntegerField
+ if data_type == cx_Oracle.NUMBER and description[5] == 0:
+ return 'IntegerField'
+ else:
+ return super(DatabaseIntrospection, self).get_field_type(
+ data_type, description)
+
def get_table_list(self, cursor):
"Returns a list of table names in the current database."
cursor.execute("SELECT TABLE_NAME FROM USER_TABLES")