From c4173d080519853112c66e7da59460ba9ff29d18 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <54437031+kzdev420@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:42:24 -0400 Subject: [PATCH] 21760 add business relationship into furnishing model (#2835) --- legal-api/src/legal_api/models/furnishing.py | 3 +++ 1 file changed, 3 insertions(+) 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)