Re: [sqlalchemy] load events with polymorphic_on

2013-09-23 Thread Philip Scott
this is normal, loading for the base class only hits those columns which are defined for that base class - it does not automatically fan out to all columns mapped by all subclasses. to do so, you can specify with_polymorphic: Ahh, thank you very much Michael that does do exactly what I want.

Re: [sqlalchemy] load events with polymorphic_on

2013-09-23 Thread Michael Bayer
On Sep 23, 2013, at 8:35 AM, Philip Scott safetyfirstp...@gmail.com wrote: this is normal, loading for the base class only hits those columns which are defined for that base class - it does not automatically fan out to all columns mapped by all subclasses. to do so, you can specify

[sqlalchemy] load events with polymorphic_on

2013-09-20 Thread Philip Scott
Hello again dear list, I have a mapped class is polymorphic with single table inheritance. I have a function wired up to the load() SA event. The dictionary in the InstanceState which is passed to the load event depends on whether I am querying on the base class or a derived one, which I don't

Re: [sqlalchemy] load events with polymorphic_on

2013-09-20 Thread Michael Bayer
this is normal, loading for the base class only hits those columns which are defined for that base class - it does not automatically fan out to all columns mapped by all subclasses. to do so, you can specify with_polymorphic: c = s.query(with_polymorphic(PolyBase,