Re: [sqlalchemy] declared_attr not working with Postgres HSTORE

2020-08-22 Thread Saakshaat Singh
pe.sub_2} > > > class Sub3(ParentModel): > @sa.declared_attr > def child_value(cls): > return ParentModel.__table__.c.get( > "child_value", sa.Column(ARRAY(MutableDict.as_mutable(HSTORE))) > ) > > __mapper_args__ = {&qu

Re: [sqlalchemy] declared_attr not working with Postgres HSTORE

2020-08-22 Thread Saakshaat Singh
def child_value(cls): > return ParentModel.__table__.c.get( > "child_value", sa.Column(ARRAY(MutableDict.as_mutable(HSTORE))) > ) > > __mapper_args__ = {"polymorphic_identity": ChildType.sub_3} > > > > e = create_en

[sqlalchemy] declared_attr not working with Postgres HSTORE

2020-08-21 Thread Saakshaat Singh
Hi, I'm working with SQLAlchemy and Postgres and I have a polymorphic model whose subclasses have a field with the same name. To allow this field to co-exist with the others and not cause any name conflicts, I'm using the `declare_attr` decorator from SQLAlchemy. This solution works well for