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
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:
(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
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
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
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:
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
) 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