Re: [sqlalchemy] Optimizing joins generated by mixin-based relationships on polymorphic subclasses

2012-11-24 Thread Michael Bayer
I'd hate to make a bad story worse here, but in fact this is also the same eager loading pattern used in some other emails I've been answering here by Martin84...it's very unusual how these never-seen-before use cases suddenly pop up in pairs..but in any case, the eager loading here is

Re: [sqlalchemy] Optimizing joins generated by mixin-based relationships on polymorphic subclasses

2012-11-24 Thread Gerald Thibault
Thanks for taking the time to look into it. It's kind of an odd case, so I wasn't particularly expecting it to work out. On Saturday, November 24, 2012 1:07:07 PM UTC-8, Michael Bayer wrote: I'd hate to make a bad story worse here, but in fact this is also the same eager loading pattern

Re: [sqlalchemy] Optimizing joins generated by mixin-based relationships on polymorphic subclasses

2012-11-23 Thread Michael Bayer
On Nov 23, 2012, at 12:57 AM, Gerald Thibault wrote: I have a base class and 3 subclasses which inherit from it polymorphically. I also have a mixin, which attempts to add a relation to the 'Extra' class, which has a foreign key to the base class. Here is the runnable test. Issuing

[sqlalchemy] Optimizing joins generated by mixin-based relationships on polymorphic subclasses

2012-11-22 Thread Gerald Thibault
I have a base class and 3 subclasses which inherit from it polymorphically. I also have a mixin, which attempts to add a relation to the 'Extra' class, which has a foreign key to the base class. Here is the runnable test. from sqlalchemy import * from sqlalchemy.ext.declarative import