[egenix-users] mxDateTime name conflict
Ksenia Marasanova
ksenia at ksenia.nl
Mon Jan 12 16:13:42 CET 2009
Hi list / developers,
I've spent the most of this day solving a really weird problem with
mx.DateTime module. In a web application I had a custom database type
for SQLAlchemy:
import sqlalchemy.types as types
class mxDateTime(types.TypeDecorator):
pass
# some code
The problem was that every time after using this class (= updating a
table that has a column of this type) the system time zone was
magically changed from 'CET' to 'UTC':
BEFORE:
from mx import DateTime
print DateTime.now().tz # prints 'CET'
UPDATE TABLE:
instance.created = DateTime.now()
# now() is still correct
# commit...
# ...
# ....
AFTER:
from mx import DateTime
print DateTime.now().tz
# prints 'UTC'
After renaming my class to "MXDateTime" the problem has disappeared!
So I just want to report that naming a class mxDateTime will probably
cause conflict with mx.DateTime internals.
Greetings
Ksenia
More information about the egenix-users
mailing list