def delete(self):
    with db.session.begin():
        for asset_group in self.asset_groups:
            asset_group.delete()
        AuditLog.delete_object(log, self)
        db.session.delete(self)
def delete(self):
    with db.session.begin():
        for asset_group in self.asset_groups:
            asset_group.delete()
        AuditLog.delete_object(log, self)
        db.session.delete(self)