From 6381ae13283227c141e93174f1dd6bd872704dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 31 Oct 2018 21:54:59 +0100 Subject: [PATCH] Delete related widgets when deleting devices --- app/devices/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/devices/models.py b/app/devices/models.py index 87919b8..5a9d73c 100644 --- a/app/devices/models.py +++ b/app/devices/models.py @@ -135,6 +135,8 @@ class Device(db.Model): cascade="save-update, merge, delete") recordings = db.relationship("Recording", cascade="save-update, merge, delete") + widgets = db.relationship("DashboardWidget", + cascade="save-update, merge, delete") def __init__(self, name, configuration=None, device_type=1): self.name = name