Jul 20 - Update Inspection list with scheduled bagde

This commit is contained in:
2026-07-20 17:27:56 -04:00
parent 18e9090780
commit 30f5b56bbb
4 changed files with 18 additions and 1 deletions
+4
View File
@@ -84,6 +84,10 @@ class Inspection(db.Model):
results = db.relationship('InspectionResult', backref='inspection', lazy='dynamic', cascade='all, delete-orphan')
issues = db.relationship('Issue', backref='inspection', lazy='dynamic', cascade='all, delete-orphan')
# The ScheduledInspection this inspection was started from (phase36), if any.
# None for ad-hoc/manual inspections or if the schedule was later deleted.
scheduled_inspection = db.relationship('ScheduledInspection',
foreign_keys=[scheduled_inspection_id])
follow_ups = db.relationship('Inspection', backref=db.backref('parent', remote_side='Inspection.id'),
lazy='dynamic', foreign_keys='Inspection.parent_inspection_id')