Reading a SMALLDATETIME field from SQL Server using adodbapi with
mxDateTime installed fails with this traceback:
Traceback (most recent call last):
File
"D:\Projects\CB\(misc)\Scripts\CbAlchemy\SqlAlchemyCbDaoTest.py", line
19, in test_saveAndUpdateCourse
course2 = self.dao.findOneCourse('ABC0101')
File "D:\Projects\CB\(misc)\Scripts\CbAlchemy\SqlAlchemyCbDao.py",
line 99, in findOneCourse
return query.select_by(code=courseId)[0]
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\query.py", line
93, in select_by
return self.select_whereclause(self.join_by(*args, **params))
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\query.py", line
232, in select_whereclause
return self._select_statement(statement, params=params)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\query.py", line
305, in _select_statement
return self.instances(statement, params=params, **kwargs)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\query.py", line
269, in instances
return self.mapper.instances(result, self.session, **kwargs)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\mapper.py",
line 627, in instances
self._instance(session, row, imap, result,
populate_existing=populate_existing)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\mapper.py",
line 1040, in _instance
self.populate_instance(session, instance, row, identitykey, imap,
isnew)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\mapper.py",
line 1070, in populate_instance
prop.execute(session, instance, row, identitykey, imap, isnew)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\orm\properties.py",
line 50, in execute
instance.__dict__[self.key] = row[self.columns[0]]
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\engine\base.py",
line 658, in __getitem__
return self.__parent._get_col(self.__row, key)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\engine\base.py",
line 597, in _get_col
return
rec[0].dialect_impl(self.dialect).convert_result_value(row[rec[1]],
self.dialect)
File
"c:\downloads\python\sqlalchemy-0.2.8\lib\sqlalchemy\databases\mssql.py",
line 134, in convert_result_value
return value.date()
TypeError: 'str' object is not callable
The problem is that convert_result_value() is getting an instance of
mx.DateTime which has a second attribute but not a callable date() method.
One solution might be to use isinstance instead of hasattr() in the
test. I removed mxDateTime from my path.
Kent
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users