问题描述
嗨,在尝试将多个表与关联表联接时,出现“未定义外键和子表”错误。
class AssociationTable(Base):
__tablename__ = 'association_table'
left_id=Column('left_id',Integer,ForeignKey('left.id')),right_id=Column('right_id',ForeignKey('right.id'))
)
class Parent(Base):
__tablename__ = 'left'
id = Column(Integer,primary_key=True)
children = relationship(
Child,secondary=association_table,back_populates="parents")
class Child(Base):
__tablename__ = 'right'
id = Column(Integer,primary_key=True)
parents = relationship(
Parent,back_populates="children") ```
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)