Refs #29444 -- Made db.backends.oracle.utils.InsertVar use str as default.

This commit is contained in:
Johannes Hoppe 2019-07-24 08:39:45 +02:00 committed by Mariusz Felisiak
parent 4f61810751
commit 003bb34b21
1 changed files with 9 additions and 2 deletions

View File

@ -10,8 +10,15 @@ class InsertVar:
insert statement.
"""
types = {
'AutoField': int,
'BigAutoField': int,
'SmallAutoField': int,
'IntegerField': int,
'BigIntegerField': int,
'SmallIntegerField': int,
'PositiveSmallIntegerField': int,
'PositiveIntegerField': int,
'FloatField': Database.NATIVE_FLOAT,
'CharField': str,
'DateTimeField': Database.TIMESTAMP,
'DateField': Database.DATETIME,
'DecimalField': Database.NUMBER,
@ -19,7 +26,7 @@ class InsertVar:
def __init__(self, field):
internal_type = getattr(field, 'target_field', field).get_internal_type()
self.db_type = self.types.get(internal_type, int)
self.db_type = self.types.get(internal_type, str)
def bind_parameter(self, cursor):
param = cursor.cursor.var(self.db_type)