Re: [sqlalchemy] Remap an SQLAlchemy instance to a different non-SQLAlchemy class

2020-07-10 Thread Mike Bayer
hey there - what you're doing is suited by an included feature of SQLAlchemy called "single table inheritance", which will return to you instances of "Mammal" or AnimalModel object based on the value of "type". see:

[sqlalchemy] Remap an SQLAlchemy instance to a different non-SQLAlchemy class

2020-07-09 Thread Raghav
Hello everyone, hope you're all doing well. I have a table which has a type column. Based on that value I need to instantiate a new class. I'm looking for a way to operate my SQLAlchemy object through this new class. Here's my model class: ``` class AnimalModel(Base): __tablename__ =