TypeError: can't compare offset-naive and offset-aware datetimes

756 views
Skip to first unread message

jo

unread,
Dec 30, 2008, 11:09:18 AM12/30/08
to sqlal...@googlegroups.com
Hi all,

I have this error:

TypeError: can't compare offset-naive and offset-aware datetimes

in the file "/usr/lib/python2.4/site-packages/sqlalchemy/orm/mapper.py", at line 1263,
when it compares datetimes...

v != params.get_original(c.key)

this is the value returned by params.get_original(c.key):
datetime.datetime(2008, 12, 30, 15, 44, 31, 418607,tzinfo=<psycopg2.tz.FixedOffsetTimezone object at 0xbd33e4c>)

and this is the value of v:
datetime.datetime(2008, 12, 30, 12, 59, 49, 742472)

tahnks for any help,

jo


a...@svilendobrev.com

unread,
Dec 30, 2008, 11:38:56 AM12/30/08
to sqlal...@googlegroups.com
lookup the group, there was someone getting similar error about
timezones last month or so

jose

unread,
Jan 1, 2009, 5:00:05 AM1/1/09
to sqlal...@googlegroups.com
I solved this problem by putting parameter timezone=True in every
DateTime Column.
Thanks anyway. :-)
jo
Reply all
Reply to author
Forward
0 new messages