Re: [sqlalchemy] override relationship in subclass

2014-02-12 Thread Michael Bayer
On Feb 11, 2014, at 9:38 PM, Eric Atkin eat...@certusllc.us wrote: Hi, I want to override a relationship in a subclass to relate to a subclass of the base attributes' related class. Perhaps an example of how I thought it should work: {{{ class Load(Base): __tablename__ = 'load'

Re: [sqlalchemy] override relationship in subclass

2014-02-12 Thread Jonathan Vanasco
Couldn't it be handled with a mixin? {{{ class _LoadCore(Base): whatever you want for both classes here pass class Load(_LoadCore): __tablename__ = 'load' __mapper_args__ = { 'polymorphic_identity':'load', 'polymorphic_on':'polymorphic_type', } id =

Re: [sqlalchemy] override relationship in subclass

2014-02-12 Thread Eric Atkin
Yeah sorry I missed that. conversion is an attribute on Measured_Source. So the intent is that a Production_Load is a Load with its own additional attributes over Load as well as a constraint that its source is a Measured_Source which has its own attribute extensions over Source. One of the

Re: [sqlalchemy] override relationship in subclass

2014-02-12 Thread Eric Atkin
@gdelta.expression is a typo. Should be @delta.expression. On Wednesday, February 12, 2014 11:53:05 AM UTC-7, Eric Atkin wrote: Yeah sorry I missed that. conversion is an attribute on Measured_Source. So the intent is that a Production_Load is a Load with its own additional attributes over

Re: [sqlalchemy] override relationship in subclass

2014-02-12 Thread Michael Bayer
On Feb 12, 2014, at 1:53 PM, Eric Atkin eat...@certusllc.us wrote: Yeah sorry I missed that. conversion is an attribute on Measured_Source. So the intent is that a Production_Load is a Load with its own additional attributes over Load as well as a constraint that its source is a

[sqlalchemy] override relationship in subclass

2014-02-11 Thread Eric Atkin
Hi, I want to override a relationship in a subclass to relate to a subclass of the base attributes' related class. Perhaps an example of how I thought it should work: {{{ class Load(Base): __tablename__ = 'load' __mapper_args__ = { 'polymorphic_identity':'load',