Я пытаюсь сделать это:
class Foo(Base):
id = Column(Integer, primary_key=True)
class Bar(Foo):
id = Column(Integer, primary_key=True)
class FooBarAssociation(Base):
foo_id = Column(Integer, ForeignKey('foo_table.id'))
bar_id = Column(Integer, ForeignKey('bar_table.id'))
foo = relationship(Foo, backref=...)
bar = relationship(Bar, backref=...)
... но я получаю такие ошибки:
Could not determine join condition between parent/child tables on relationship FooBarAssociation.foo. Specify a 'primaryjoin' expression. If this is a many-to-many relationship, 'secondaryjoin' is needed as well.
Я пробовал указывать external_keys и primary_join-s в объявлениях отношений, но все напрасно. Помощь? Наследство Бара от Фу надо мной издевается?
Благодарность!