Open zteeed opened 4 years ago
class Vote(Base): __tablename__ = 'vote' id = Column(Integer, primary_key=True) member = relationship('Member') poste = relationship('Poste') candidature = relationship('Candidature') poste_id = Column(Integer, ForeignKey('poste.id', ondelete="CASCADE")) member_id = Column(Integer, ForeignKey("member.id", ondelete="CASCADE")) candidat_id = Column(Integer, ForeignKey('candidature.id', ondelete="CASCADE"))
J'ai remarqué qu'une concordance entre le __tablename__ et ne nom indiqué dans ForeignKey résoud le problème
__tablename__
ForeignKey
De plus, a quoi sert poste_id et member_id dans Vote si ils sont deja dans Candidature par jointure de table sur candidat_id ?
poste_id
member_id
Vote
Candidature
candidat_id
J'ai remarqué qu'une concordance entre le
__tablename__
et ne nom indiqué dansForeignKey
résoud le problème