this is logged as http://www.sqlalchemy.org/trac/ticket/2714 for further study, this is an extremely complicated use case and I may have insight on it today, or I might not have insight on it until next week. I will have to find the time to look into it more deeply.
On Apr 24, 2013, at 8:35 AM, gvv <[email protected]> wrote: > Hi All, > > using 7.10 but falls over also in 8.0. > > User has a One2One UserPerson. > UserPerson inherits from Person. > Person has a One2Many PersonAddress. > PersonAddress inherits from Address. > Address has a One2Many Phone and One2Many Email. > > The following query falls over with an (OperationalError) no such column: > Address.Id. > > session.query(User, UserPerson, PersonAddress).filter(User.Id == 1).\ > > outerjoin(User.Personal,UserPerson.Addresses,PersonAddress.Phones,PersonAddress.Emails).first() > > What am I doing wrong ? > > Thanks in advance for your help. > > > sqlalchemy.exc.OperationalError: (OperationalError) no such column: > Address.Id u'SELECT "User"."Id" AS "User_Id", anon_1."UserPerson_Id" AS > "anon_1_UserPerson_Id", anon_1."Person_Id" AS "anon_1_Person_Id", > anon_1."Person_PersonType" AS "anon_1_Person_PersonType", > anon_1."UserPerson_ItemUserPerson_Id" AS > "anon_1_UserPerson_ItemUserPerson_Id", anon_2."PersonAddress_Id" AS > "anon_2_PersonAddress_Id", anon_2."Address_Id" AS "anon_2_Address_Id", > anon_2."Address_AddressType" AS "anon_2_Address_AddressType", > anon_2."PersonAddress_ItemPerson_Id" AS "anon_2_PersonAddress_ItemPerson_Id" > \nFROM "User" LEFT OUTER JOIN (SELECT "Person"."Id" AS "Person_Id", > "Person"."PersonType" AS "Person_PersonType", "UserPerson"."Id" AS > "UserPerson_Id", "UserPerson"."ItemUserPerson_Id" AS > "UserPerson_ItemUserPerson_Id" \nFROM "Person" JOIN "UserPerson" ON > "UserPerson"."Id" = "Person"."Id") AS anon_1 ON > anon_1."UserPerson_ItemUserPerson_Id" = "User"."Id" LEFT OUTER JOIN (SELECT > "Address"."Id" AS "Address_Id", "Address"."AddressType" AS > "Address_AddressType", "PersonAddress"."Id" AS "PersonAddress_Id", > "PersonAddress"."ItemPerson_Id" AS "PersonAddress_ItemPerson_Id" \nFROM > "Address" JOIN "PersonAddress" ON "PersonAddress"."Id" = "Address"."Id") AS > anon_2 ON anon_1."Person_Id" = anon_2."PersonAddress_ItemPerson_Id" LEFT > OUTER JOIN "Phone" ON anon_2."Address_Id" = "Phone"."ItemPhone_Id" LEFT OUTER > JOIN "Email" ON "Address"."Id" = "Email"."ItemEmail_Id" \nWHERE "User"."Id" = > ?\n LIMIT ? OFFSET ?' (1, 1, 0) > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > <test.py><decl_enum.py> -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
