Skip to content

Commit

Permalink
fixed issue 1390, dateTtime separator in MSSQL, thanks score2000
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Mar 15, 2013
1 parent e48074f commit e4a9612
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion gluon/dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ class BaseAdapter(ConnectionPool):

TRUE = 'T'
FALSE = 'F'
T_SEP = ' '
types = {
'boolean': 'CHAR(1)',
'string': 'CHAR(%(length)s)',
Expand Down Expand Up @@ -1810,7 +1811,7 @@ def represent(self, obj, fieldtype):
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:
Expand Down Expand Up @@ -3033,6 +3034,7 @@ def _fetchall(self):

class MSSQLAdapter(BaseAdapter):
drivers = ('pyodbc',)
T_SEP = 'T'

types = {
'boolean': 'BIT',
Expand Down

0 comments on commit e4a9612

Please sign in to comment.