fixed issue 1390, dateTtime separator in MSSQL, thanks score2000
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.4.4-stable+timestamp.2013.03.15.10.00.02
|
||||
Version 2.4.4-stable+timestamp.2013.03.15.10.05.12
|
||||
|
||||
+3
-1
@@ -633,6 +633,7 @@ class BaseAdapter(ConnectionPool):
|
||||
|
||||
TRUE = 'T'
|
||||
FALSE = 'F'
|
||||
T_SEP = ' '
|
||||
types = {
|
||||
'boolean': 'CHAR(1)',
|
||||
'string': 'CHAR(%(length)s)',
|
||||
@@ -1810,7 +1811,7 @@ class BaseAdapter(ConnectionPool):
|
||||
obj = str(obj)
|
||||
elif fieldtype == 'datetime':
|
||||
if isinstance(obj, datetime.datetime):
|
||||
obj = obj.isoformat()[:19].replace('T',' ')
|
||||
obj = obj.isoformat(self.T_SEP)[:19]
|
||||
elif isinstance(obj, datetime.date):
|
||||
obj = obj.isoformat()[:10]+' 00:00:00'
|
||||
else:
|
||||
@@ -3033,6 +3034,7 @@ class OracleAdapter(BaseAdapter):
|
||||
|
||||
class MSSQLAdapter(BaseAdapter):
|
||||
drivers = ('pyodbc',)
|
||||
T_SEP = 'T'
|
||||
|
||||
types = {
|
||||
'boolean': 'BIT',
|
||||
|
||||
Reference in New Issue
Block a user