On 9/11/06, Olli Wang <[EMAIL PROTECTED]> wrote:
>
> My SQLAlchemy version is 0.2.8(not SVN). but the error I got is from
> the default model of TG, I don't understand what's the relationship
> with that ticket.  BTW, the "tg-admin sql drop" doesn't work, either. :(

The error you're getting indicates that datetime objects without
timezones ("naive" datetimes) are being compared to datetime objects
with timezones ("aware" datetimes), which is an error. (How do you
compare the time "11:45:00" with the time "12:00:00 GMT"? The answer
depends on what timezone you're in, and in the face of ambiguity,
Python refuses to guess). The discussion on that ticket has to do with
how such a comparison might happen.

Try setting "sqlalchemy.echo=1" on in your dev.cfg and look at the SQL
being produced. You'll probably notice that the visit table's datetime
columns are being specified as "TIMESTAMP WITH TIME ZONE". But the
datetime.now() method defaults to returning a naive
(non-timezone-aware) datetime, which when compared to a "TIMESTAMP
WITH TIME ZONE" type will fail due to the timezone-comparison
ambiguity.

The solution here would be to either change the definition of the
visit (and other) tables to use "timezone=False" in their SQLAlchemy
column definitions, or else to pass a timezone argument to the
"datetime.now()" function when it's called.

-- 
Robin Munn
[EMAIL PROTECTED]
GPG key 0xD6497014

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to