[sqlalchemy] SQLAlchemy and

2014-04-07 Thread artee
Hi SQLAlchemy==0.9.3 and Versioned mixin pattern are used. I've encountered a problem when timezones are used in date & time fields e.g.: DateTime(timezone=True). In Versioned mixin, create_version functions fails at attributes.get_historyfunction with the exception as follows: can't compare of

Re: [sqlalchemy] SQLAlchemy and

2014-04-09 Thread artee
UTC+2 użytkownik Michael Bayer napisał: > > > On Apr 7, 2014, at 4:07 AM, artee > wrote: > > Hi > > SQLAlchemy==0.9.3 and Versioned mixin pattern are used. > > I've encountered a problem when timezones are used in date & time fields > e.g.: Dat

[sqlalchemy] Postgres' arrays in subqueries

2015-10-01 Thread artee
Mike and others :) I have the following sql: select models.code, *array*( select *(clients.id, clients.code) *from clients group by clients.id, clients.code ) as envs from models I ended with something like this: items = DBSession.query(Client.id, Client.code). \

[sqlalchemy] How to pass "AT TIME ZONE" to the query object ?

2008-04-21 Thread artee
Hi DB is based on the Postgres. I have tables with some fields with DateTime(timezone=True). I know how to pass default values with custom time zone to 'insert'. But how to pass my time zone to the query object? In Postgres I can use e.g. "AT TIME ZONE ''PST'" construction in select to convert da

[sqlalchemy] Problem with SQL views

2006-10-16 Thread artee
Hi I've been using SQLAlchemy for some queries based on the SQL views (Postgres). The problem is in results returned from session.query. Depending on the method (session or not) for a table with a lot of items results are not the same: metadata = BoundMetaData('postgres://blabla') wlt = Table('w

[sqlalchemy] Re: Problem with SQL views

2006-10-17 Thread artee
Michael Bayer wrote: > first thing, "wlt" is a view? thats very surprising that "autoload" > would work with that...but then im not so famliar with the specifics It's working :) Views are transparent to the DB engine and should be visible as tables. > of postgres views. Views are one of most imp