1
0
forked from ScoDoc/ScoDoc

cascade sur les offres et les contacts

This commit is contained in:
Arthur ZHU 2021-12-23 23:19:31 +01:00
parent 30eb738c25
commit 93d026d2ac

View File

@ -9,8 +9,8 @@ class Entreprise(db.Model):
codepostal = db.Column(db.Text)
ville = db.Column(db.Text)
pays = db.Column(db.Text)
contacts = db.relationship('EntrepriseContact', backref='entreprise', lazy='dynamic')
offres = db.relationship('EntrepriseOffre', backref='entreprise', lazy='dynamic')
contacts = db.relationship('EntrepriseContact', backref='entreprise', lazy='dynamic', cascade="all, delete-orphan")
offres = db.relationship('EntrepriseOffre', backref='entreprise', lazy='dynamic', cascade="all, delete-orphan")
class EntrepriseContact(db.Model):
__tablename__ = "entreprise_contact"