Delete related widgets when deleting devices

develop
Ensar Sarajčić 2018-10-31 21:54:59 +01:00
parent 83116c28c6
commit 6381ae1328
1 changed files with 2 additions and 0 deletions

View File

@ -135,6 +135,8 @@ class Device(db.Model):
cascade="save-update, merge, delete") cascade="save-update, merge, delete")
recordings = db.relationship("Recording", recordings = db.relationship("Recording",
cascade="save-update, merge, delete") cascade="save-update, merge, delete")
widgets = db.relationship("DashboardWidget",
cascade="save-update, merge, delete")
def __init__(self, name, configuration=None, device_type=1): def __init__(self, name, configuration=None, device_type=1):
self.name = name self.name = name