Re: [sqlalchemy] Array with custom types in SqlAlchemy 0.8b2

2013-01-07 Thread Hans Lellelid
I am looking to adapt this code for a related array/type issue. The code from https://gist.github.com/4433940 works just fine for me (as expected) when building/executing the stmt directly, but not when using the ORM. When row is created using ORM, like this: # snip s =

Re: [sqlalchemy] Array with custom types in SqlAlchemy 0.8b2

2013-01-07 Thread Hans Lellelid
around at this time. If you're working with arrays of UUID I'd recommend using psycopg2 type processors, as the previous poster has had success with. On Jan 7, 2013, at 9:39 AM, Hans Lellelid wrote: I am looking to adapt this code for a related array/type issue. The code from https

[sqlalchemy] Inactive transactions and commit/rollback from Session

2009-11-12 Thread Hans Lellelid
Hi - I'm using SA in conjunction w/ Pylons, in their default (0.9.7) approach -- i.e. using scoped session classes created by calling something like: sm = orm.sessionmaker(autoflush=True, autocommit=False, bind=engine) meta.Session = orm.scoped_session(sm) I have a base controller that is

[sqlalchemy] Re: Inactive transactions and commit/rollback from Session

2009-11-12 Thread Hans Lellelid
Hi Michael - Thanks for the response! 1) Isn't this what meta.Session.is_active should be testing for? it is.   I'm not familiar with a codepath which can cause that to happen, and in fact even if the session isn't active, it still should be totally fine to call commit().  Try this as an

[sqlalchemy] Filtering lazy='dynamic' collection on class type (single-table inheritance)

2009-01-30 Thread Hans Lellelid
Hi, I did a quick search but couldn't find the right way to do this in SA. For the sake of example, I have a many-to-many relationshp between Book and Reader. The 'books' property of reader is loaded using lazy='dynamic'. And, finally, Book is mapped with single-table inheritance and has

[sqlalchemy] Re: Filtering lazy='dynamic' collection on class type (single-table inheritance)

2009-01-30 Thread Hans Lellelid
On Jan 30, 2:37 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jan 30, 2009, at 1:39 PM, Hans Lellelid wrote: Hi, I did a quick search but couldn't find the right way to do this in SA. For the sake of example, I have a many-to-many relationshp between Book and Reader

[sqlalchemy] Using database functions in UPDATE statement

2008-09-19 Thread Hans Lellelid
Hi, I'm using SA 0.4.6 and I'm having trouble using the result of a database function / stored procedure in an UPDATE statement (being constructed with SQL expression lang). This happens to be for using PostGIS columns; however, that is not relevant to the problem here. I have tried doing

[sqlalchemy] Re: Using database functions in UPDATE statement

2008-09-19 Thread Hans Lellelid
==idvar, {'geocolumn': func.GeomFromText(wkt, 4326)}) while this does not: up = mytable.update(mytable.c.id==idvar) conn.execute(up, {'geocolumn': func.GeomFromText(wkt, 4326)}) It wasn't obvious to me that these were not equivalent. Sorry for the confusion! Hans On Sep 19, 12:52 pm, Hans

[sqlalchemy] Re: Using database functions in UPDATE statement

2008-09-19 Thread Hans Lellelid
ah.   right, the parameter argument of execute() does not handle SQL   expressions as values - the keys are used to generate a corresponding   list of bind parameter clauses.   Earlier versions of SQLA were more   liberal in this regard but the current behavior was based around   simplifying