yes, at the moment, you can make that work by specifying explicit
join conditions:
Blub.mapper = mapper(Blub, blub, inherits=Bar.mapper,
properties={
'bars':relation(Bar.mapper, blub_bar,
primaryjoin=blub.c.id==blub_bar.c.blub_id,
secondaryjoin=blub_bar.c.bar_id==bar.c.id, lazy=True),
'foos':relation(Foo.mapper, blub_foo,
primaryjoin=blub.c.id==blub_foo.c.blub_id,
secondaryjoin=blub_foo.c.foo_id==foo.c.id, lazy=True),
})
eager loading is working better over here but still not quite.
On Mar 8, 2006, at 12:49 PM, Florian Boesch wrote:
Yes right I tried it just now. Altough taking away lazy=False makes
the
exceptions go out of my face, it is still not correct. The join
over the
intermediate table gives me all entries from the intermediate
instead of just
the ones associated with the one instance I'm querying them from.
Quoting Michael Bayer <[EMAIL PROTECTED]>:
Your test program, which is also becoming a unit test, works if you
convert the eager loads to lazy loads. both problems are related to
the formulation of an eager load against a parent object, which also
has an inheritance relationship to the thing you are eager
loading...there are a few places it gets confused. its not related
to Oracle.
now the tricky part, is getting the eager loads to work. I will have
to do some more tinkering with the fundamentals of "mapper
inheritance" to get it going.
On Mar 8, 2006, at 9:52 AM, Florian Boesch wrote:
Hi, I've analyzed my previous problem and boiled it down to a test
program
(atached).
There's two issues connected to it both visible in the test
programm as
appended tracebacks.
To the basic principle. I have three tables, one base table, one
table that in
herits base and antother table that inherits the one that inherits
from base.
Expressed in more simple terms, I've got A, B inheriting A, C
inheriting B.
On why I do such wicked things: Say I've got something like
content. So there's
page content. But there can be different kinds of pages, like a
Link list, a
news teaser etc. So page would inherit content, and news teaser
would inherit
page. On the other hand there can be products, which also inherit
content. So
there you are.
Cheers,
Florian
<inheritance_test.py>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the
live webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?
cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users