Merged in bugfix/device-deletion (pull request #40)

Delete related widgets when deleting devices
develop
Ensar Sarajcic 2018-10-31 20:56:05 +00:00
commit d1a59c404b
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