Re: [SQLObject] DateTimeCol and mx.DateTime
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: rharper <rh...@sh...> - 2004-10-09 20:15:52
|
* rharper <rh...@sh...> [2004-10-09 14:32]:
> Here is a testcase that seems to show DateTimeCol() broken for
> mx.DateTime objects. This worked for me in 0.5.2. Could be the mysqldb
> underneath SQLObject. Anyone seen this?
Did a little more digging and mysqldb 1.1.5 includes a new
DateTime_or_None method that uses python 2.2.3 datetime.
/usr/lib/python2.3/site-packages/MySQLdb/times.py:
...
try:
from pytimes import *
except ImportError:
try:
from mxdatetimes import *
except ImportError:
# no DateTime? We'll muddle through somehow.
from stringtimes import *
It uses pytimes which is written to use datetime.datetime. By moving
pytimes.* out of the way, it will fallback on mx.DateTime. There
doesn't seem to be a way to configure mysqldb to use one over the other.
In any case, the test passes with pytimes.py out of the way:
(shake) tests # python test.py
Testing mysql
............................................................
----------------------------------------------------------------------
Ran 60 tests in 8.231s
OK
Ryan Harper
|