Lets say we have this pattern

Tables A make a reference to B, and both makes a reference to P

A -> B

A -> P
B -> P

I need 2 aliases of P to make a query having conditions against P

P1 = aliased(P)
P2 = aliased(P)

Now I make a query, with outerjoins

session.query(A).outerjoin(B).outerjoin(A.p).outerjoin(B.p)

where we assume that  A.p and B.p point to some P

BUT I need an alias if I want to filter the former expression.

So I'm trying to do

session.query(A).outerjoin(B).outerjoin(P1, A.p).outerjoin(P2, B.p)

and I get an error like:

ArgumentError: Can't determine join between 'Join object on Join
object on acto(41154288) and involucramiento(41251760)(45192432) and
involucramiento(41251760)' and '{ANON 44007952 persona}'; tables have
more than one foreign key constraint relationship between them. Please
specify the 'onclause' of this join explicitly.

Other patterns, as one table having 2 foreign references to another
table works fine, like this:

A -> P
A -> P
with
P1 = aliased(P)
P2 = aliased(P)

but not this one.

Do I am doing something wrong?
Any help will be greatly appreciated!!!

Adolfo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to