diff --git a/legal-api/src/legal_api/models/furnishing.py b/legal-api/src/legal_api/models/furnishing.py index 9ce9ba149e..f5e744fe1d 100644 --- a/legal-api/src/legal_api/models/furnishing.py +++ b/legal-api/src/legal_api/models/furnishing.py @@ -78,6 +78,9 @@ class FurnishingStatus(BaseEnum): batch_id = db.Column('batch_id', db.Integer, db.ForeignKey('batches.id'), index=True, nullable=False) business_id = db.Column('business_id', db.Integer, db.ForeignKey('businesses.id'), index=True, nullable=False) + # relationships + business = db.relationship('Business', backref=db.backref('furnishings', lazy=True)) + def save(self): """Save the object to the database immediately.""" db.session.add(self)