sql alcehmy orm模型将多个模型组合为一个模型

sql alcehmy orm模型将多个模型组合为一个模型,orm,sqlalchemy,single-table-inheritance,Orm,Sqlalchemy,Single Table Inheritance,我有一个表,有很多列,比如说100列。 这个名为sayrecords的单表存储多种类型的记录,类似于单表继承。我想设计像这样的SQL炼金术模型 Class BaseRecord(db.Model): ## common attributes their getter and setter here Class RecordOne(BaseRecord): ## specific attributes and their getter and setter here Class Rec

我有一个表,有很多列,比如说100列。 这个名为say
records
的单表存储多种类型的记录,类似于单表继承。我想设计像这样的SQL炼金术模型

Class BaseRecord(db.Model):
  ## common attributes their getter and setter here

Class RecordOne(BaseRecord):
  ## specific attributes and their getter and setter here

Class RecordTwo(BaseRecord):
 ## specific attributes and their getter and setter here

Class Record(RecordOne, RecordTwo):
 ## functions to query records table here
这里的问题是ORM映射器只将RecordOne类属性映射到Record。我无法使用Record类插入与RecordTwo相关的任何内容。 我想要这样的自由,如果我知道记录的类型,我可以使用RecordOne或RecordTwo插入,或者如果我不知道应该使用record插入的类型