yeah I am not a huge fan of declared_attr.cascading except for maybe a table
name convention
On Sun, Nov 28, 2021, at 11:38 PM, niuji...@gmail.com wrote:
> Thanks for pointing this out. It did address this problem already.
> I just solved this by manually adding all the primary/foreign keys to ea
Thanks for pointing this out. It did address this problem already.
I just solved this by manually adding all the primary/foreign keys to each
classes. Not a big deal, actually it helps clear code!
On Sunday, November 28, 2021 at 6:37:30 PM UTC-8 Mike Bayer wrote:
> this is addressed in the docs
this is addressed in the docs which discuss "cascading" here:
https://docs.sqlalchemy.org/en/14/orm/declarative_mixins.html#mixing-in-columns-in-inheritance-scenarios
"The `declared_attr.cascading` feature currently does *not* allow for a
subclass to override the attribute with a different funct
I've just manually put this line to the `Programmer` class definition, but
it still gives me the same error, strangely:
class Programmer(Engineer):
__tablename__ = 'programmer'
record_id = Column(ForeignKey('engineer.record_id'),
primary_key=True)
On Sunda
On Sun, Nov 28, 2021, at 4:24 AM, niuji...@gmail.com wrote:
> I'm using the "joined table inheritance" model. I have three levels of
> inheritance.
>
> class has_polymorphic_id(object):
> @declared_attr.cascading
> def record_id(cls):
> if has_inherited_table(cls):
>
I'm using the "joined table inheritance" model. I have three levels of
inheritance.
class has_polymorphic_id(object):
@declared_attr.cascading
def record_id(cls):
if has_inherited_table(cls):
return Column(ForeignKey('employee.record_id'),
pri