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'
|
TRUE = 'T'
|
||||||
FALSE = 'F'
|
FALSE = 'F'
|
||||||
|
T_SEP = ' '
|
||||||
types = {
|
types = {
|
||||||
'boolean': 'CHAR(1)',
|
'boolean': 'CHAR(1)',
|
||||||
'string': 'CHAR(%(length)s)',
|
'string': 'CHAR(%(length)s)',
|
||||||
@@ -1810,7 +1811,7 @@ class BaseAdapter(ConnectionPool):
|
|||||||
obj = str(obj)
|
obj = str(obj)
|
||||||
elif fieldtype == 'datetime':
|
elif fieldtype == 'datetime':
|
||||||
if isinstance(obj, datetime.datetime):
|
if isinstance(obj, datetime.datetime):
|
||||||
obj = obj.isoformat()[:19].replace('T',' ')
|
obj = obj.isoformat(self.T_SEP)[:19]
|
||||||
elif isinstance(obj, datetime.date):
|
elif isinstance(obj, datetime.date):
|
||||||
obj = obj.isoformat()[:10]+' 00:00:00'
|
obj = obj.isoformat()[:10]+' 00:00:00'
|
||||||
else:
|
else:
|
||||||
@@ -3033,6 +3034,7 @@ class OracleAdapter(BaseAdapter):
|
|||||||
|
|
||||||
class MSSQLAdapter(BaseAdapter):
|
class MSSQLAdapter(BaseAdapter):
|
||||||
drivers = ('pyodbc',)
|
drivers = ('pyodbc',)
|
||||||
|
T_SEP = 'T'
|
||||||
|
|
||||||
types = {
|
types = {
|
||||||
'boolean': 'BIT',
|
'boolean': 'BIT',
|
||||||
|
|||||||
Reference in New Issue
Block a user