[egenix-users] Fwd: mxDateTime name conflict
Ksenia Marasanova
ksenia at ksenia.nl
Mon Jan 12 16:29:16 CET 2009
Hmm, I guess I spoke too soon. The magical time zone change happens
still...
Sorry for the noise. If anyone has any idea what can cause this I'll
be very happy to hear.
Ksenia.
Begin doorgestuurd bericht:
> Van: Ksenia Marasanova <ksenia at ksenia.nl>
> Datum: 12 januari 2009 16:13:42 GMT+01:00
> Aan: egenix-users at egenix.com
> Onderwerp: mxDateTime name conflict
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman-archives/egenix-users/attachments/20090112/08bfe0da/attachment.htm
More information about the egenix-users
mailing list