def alarm_destroy(self, id):
    with _session_for_write() as session:
        query = model_query(models.Alarm, session=session)
        query = query.filter_by(uuid=id)
        try:
            query.one()
        except NoResultFound:
            raise exceptions.AlarmNotFound(alarm=id)
        query.delete()
def alarm_destroy(self, id):
    with _session_for_write() as session:
        query = model_query(models.Alarm, session=session)
        query = query.filter_by(uuid=id)
        try:
            query.one()
        except NoResultFound:
            raise exceptions.AlarmNotFound(alarm=id)
        query.delete()