Re: [sqlalchemy] If path in joinedload() include self-referential relationship, should I alias() every table after that relation ?

2015-07-15 Thread Mike Bayer
On 7/15/15 4:40 PM, Юрий Пайков wrote: Ok, that is clear now. Eagerloading of tables occurring more than once in a query is a bit confusing for me as it is not well-documented, for example that *contains_eager()* needs *alias=* in order to work properly for a second occurrence of a table. If

Re: [sqlalchemy] If path in joinedload() include self-referential relationship, should I alias() every table after that relation ?

2015-07-15 Thread Юрий Пайков
Ok, that is clear now. Eagerloading of tables occurring more than once in a query is a bit confusing for me as it is not well-documented, for example that *contains_eager()* needs *alias=* in order to work properly for a second occurrence of a table. If I might I would advise you to shed some

Re: [sqlalchemy] If path in joinedload() include self-referential relationship, should I alias() every table after that relation ?

2015-07-15 Thread Mike Bayer
On 7/15/15 2:42 AM, Юрий Пайков wrote: I have an example here https://gist.github.com/ojomio/aa5eca3bea03d21e00e8. This code issue exactly one query and load everything at one time What I am asking about is line https://gist.github.com/ojomio/aa5eca3bea03d21e00e8#file-gistfile1-py-L65 If I

[sqlalchemy] If path in joinedload() include self-referential relationship, should I alias() every table after that relation ?

2015-07-14 Thread Юрий Пайков
I have an example here https://gist.github.com/ojomio/aa5eca3bea03d21e00e8. This code issue exactly one query and load everything at one time What I am asking about is line https://gist.github.com/ojomio/aa5eca3bea03d21e00e8#file-gistfile1-py-L65 If I don not use alias *second_B* and simply writ