[sqlalchemy] eager load polymorphic relation

2013-05-17 Thread me
using python 2.7, sqla 0.7.9, postgresql 9.1 i'm trying to eager load a relationship to a polymorphic target (the target uses joined table inheritance). here is example: http://pastebin.com/xSiHS4QW and this is output: SELECT ... FROM container LEFT OUTER JOIN root AS

[sqlalchemy] joined table inhertiance and eager loading self-referencing relationships

2012-10-07 Thread me
using python 2.7, sqla 0.7.9, postgresql 9.1 i've setup joined table inheritance and wanted an eager loaded relationship from one of the derived objects to another derived object. when i do that i get what seems to be a really inefficient query. here is the minimal setup:

[sqlalchemy] Re: sqla 0.6.4, orm, problem with self-referring joins

2010-09-20 Thread me
(orm.contains_eager(A.some_b, alias=AliasedB1)) print q = On Sep 20, 7:56 am, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 19, 2010, at 11:59 PM, me wrote: when i apply multiple joins to orm query, one of them self-referring, using (target, property) form sqla generates the wrong

[sqlalchemy] sqla 0.6.4, orm, problem with self-referring joins

2010-09-19 Thread me
when i apply multiple joins to orm query, one of them self-referring, using (target, property) form sqla generates the wrong join criteria by selecting aliased table for the left side of the join. tried sqla 0.5.8 and 0.6.4, same result. e.g. for sqla 0.6.4 from

[sqlalchemy] Re: 0.55, orm, varying relation join on criteria

2009-09-15 Thread me
if anyone's interested: http://code.activestate.com/recipes/496741/ http://code.activestate.com/recipes/519639/ On Sep 14, 2:13 pm, Michael Bayer mike...@zzzcomputing.com wrote: me wrote: For certain orm queries with a 1-to-many relation i want to left outer join and then update the on-clause

[sqlalchemy] 0.55, orm, varying relation join on criteria

2009-09-14 Thread me
For certain orm queries with a 1-to-many relation i want to left outer join and then update the on-clause for that relation. Since the criteria changes between queries I cannot fix the join criteria when specifying my object/table mappings. For example: tables: user, email relation:

[sqlalchemy] Re: 0.5.2, orm, deferring joined columns during query construction

2009-03-14 Thread me
doing that as I wanted an instance of a root object and the query.one() problem. Thanks, M On Mar 12, 8:56 am, Michael Bayer mike...@zzzcomputing.com wrote: me wrote: 2] Using path to the joined column: query = query.option(defer(a.s1_relation.col1), defer (a.s1_alias_relation.col2),...) 2

[sqlalchemy] 0.5.2, orm, deferring joined columns during query construction

2009-03-12 Thread me
) and then extract that to a dictionary. So pulling S1.x, S2.y, S1Alias.x into the result, making it a tuple, seems a little strange. 2 Simply doesn't work for me (i.e. the columns i'm deferring are clearly in the echoed sql). I also tried passing instrumented object attributes to defers like this: query