Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-24 Thread Michael Bayer
On Nov 24, 2014, at 1:00 AM, Victor Reichert vfr...@gmail.com wrote: I've taken another look at trying to eager load the address.parent. Is it possible to do that? Unfortuntately not really. It should be in theory but I’m not able to work out an eager load that goes to both Customer

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-24 Thread Michael Bayer
On Nov 24, 2014, at 12:31 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 24, 2014, at 1:00 AM, Victor Reichert vfr...@gmail.com mailto:vfr...@gmail.com wrote: I've taken another look at trying to eager load the address.parent. Is it possible to do that? Unfortuntately

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-24 Thread Michael Bayer
On Nov 24, 2014, at 5:16 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Nov 24, 2014, at 12:31 PM, Michael Bayer mike...@zzzcomputing.com mailto:mike...@zzzcomputing.com wrote: On Nov 24, 2014, at 1:00 AM, Victor Reichert vfr...@gmail.com mailto:vfr...@gmail.com wrote:

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-24 Thread Victor Reichert
Thank you! You are not an SQL alchemist, you are a SQL Wizard! Thank you again! For bonus points, an order by is possible on the discriminator like objects are returned consecutively: poly = with_polymorphic( AddressAssociation, [Customer.assoc_cls, Supplier.assoc_cls],

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-24 Thread Victor Reichert
I should add the final version of my file ist at: https://gist.github.com/vfr292/3330037cf5bc621d3d4b should anyone want to reference it. Thank you again Mr. Bayer! On Monday, November 24, 2014 11:00:06 PM UTC-8, Victor Reichert wrote: Thank you! You are not an SQL alchemist, you are a SQL

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-23 Thread Victor Reichert
I've taken another look at trying to eager load the address.parent. Is it possible to do that? I've tried a couple of ways, pasted a below. My full code is at: https://gist.github.com/vfr292/a5939418285e4c8bd03b eager_addresses = session.query(Address).options(joinedload(Address.parent))

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-10-28 Thread Victor Reichert
Thank you for your response, and double thank you for Sqlalchemy! I was misunderstanding the second query. I now see that the eager load is working properly. Thanks! So I know the limitations of my approach, it is possible to eager load the address.parent? I've tried: eager_addresses =

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-10-26 Thread Michael Bayer
On Oct 26, 2014, at 12:07 AM, Victor Reichert vfr...@gmail.com wrote: Hi, I am following the Generic Association with Discriminator on Association example at: http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/discriminator_on_association.html

[sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-10-25 Thread Victor Reichert
Hi, I am following the Generic Association with Discriminator on Association example at: http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/discriminator_on_association.html However, I would like to eager load the customer.addresses in a query like eager_sales_persons