Re: [sqlalchemy] Replace relationship values with join() call

2017-11-30 Thread Анатолий Иванов
Hi Mike! Thanks for answering. In fact i tried that same code as you posted and it did eager load of original (not my subquery) data. However, here i found a mention that contains_eager has an alias parameter, so doing s.query(A).join

Re: [sqlalchemy] Replace relationship values with join() call

2017-11-30 Thread Mike Bayer
On Thu, Nov 30, 2017 at 8:41 AM, Анатолий Иванов wrote: > Hello everyone! > > > TL;DR: > A mapping (class A) has a relationship(to class B). Lazy load is specified. > I want to > > manually select and filter data from B (the result lets call B') > select everything from A > outer join A with B' >

[sqlalchemy] Replace relationship values with join() call

2017-11-30 Thread Анатолий Иванов
Hello everyone! *TL;DR:* A mapping (class A) has a relationship(to class B). Lazy load is specified. I want to 1. manually select and filter data from B (the result lets call B') 2. select everything from A 3. outer join A with B' Problem: when doing all_b = session.query(B).filter