Re: [sqlalchemy] Getting comparison TypeError when trying to commit "aware" datetime when previous value was "naive" datetime

2012-05-13 Thread Steve Zatz
> you should only be dealing with timezone-naive datetimes within a Python application Thanks - make sense although the klugey way around the problem is just to commit None before you change between naive and aware since comparisons with None are fine. -- You received this message because you are

Re: [sqlalchemy] Getting comparison TypeError when trying to commit "aware" datetime when previous value was "naive" datetime

2012-05-13 Thread Michael Bayer
the ORM needs to compare in order to determine changes, and in general you should only be dealing with timezone-naive datetimes within a Python application, I'd suggest ensuring they are all in UTC in fact. It's no different IMHO from converting encoded strings to unicode first so that all value

[sqlalchemy] Getting comparison TypeError when trying to commit "aware" datetime when previous value was "naive" datetime

2012-05-12 Thread Steve Zatz
When I try to commit a timezone aware datetime to replace a value that was previously timezone naive, I get a TypeError when I try to do the commit with the message: TypeError: can't compare offset-naive and offset-aware datetimes Now I am not trying to compare anything but just store the new val