Re: [sqlalchemy] single table inheritance and instrument_class events

2017-01-17 Thread Chris Withers
On 17/01/2017 15:08, mike bayer wrote: On 01/17/2017 06:15 AM, Chris Withers wrote: Great, thanks. I assume has_inherited_table returns False where the table is defined on the class itself? it looks like has_inherited_table is just looking for non-None __table__ attribute up the inheritance

Re: [sqlalchemy] single table inheritance and instrument_class events

2017-01-17 Thread mike bayer
On 01/17/2017 06:15 AM, Chris Withers wrote: Great, thanks. I assume has_inherited_table returns False where the table is defined on the class itself? it looks like has_inherited_table is just looking for non-None __table__ attribute up the inheritance chain. (ie: normal models, and the

Re: [sqlalchemy] single table inheritance and instrument_class events

2017-01-17 Thread Chris Withers
Great, thanks. I assume has_inherited_table returns False where the table is defined on the class itself? (ie: normal models, and the "base" model in the case of single table inheritance) Chris On 16/01/2017 17:49, mike bayer wrote: at the declarative level we have this:

Re: [sqlalchemy] single table inheritance and instrument_class events

2017-01-16 Thread mike bayer
at the declarative level we have this: http://docs.sqlalchemy.org/en/latest/orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.has_inherited_table this might be better since you're really looking for a "table" up above On 01/16/2017 12:05 PM, Chris Withers wrote: Hi All, If

[sqlalchemy] single table inheritance and instrument_class events

2017-01-16 Thread Chris Withers
Hi All, If I'm using instrument_class events to add some constraints to a table, what's the 'right' way to spot when it's a subclass is being instrumented? (where I'm guessing I shouldn't add the constraints). My current attempt is here: