Ejemplo n.º 1
0
    def delete(self, id, project_id=None):
        """delete."""
        result = DB_SESSION.query(Result).filter_by(id=id).first()
        if result is None:
            response = jsonify({
                'result': None, 'message': 'No interface defined for URL.'
            })
            return response, 404

        DB_SESSION.delete(result)
        DB_SESSION.commit()

        return jsonify({'result': result.serialize})
Ejemplo n.º 2
0
    def delete(self, id):
        """delete."""
        project = DB_SESSION.query(Project).filter_by(id=id).first()

        if project is None:
            response = jsonify({
                'projects': None,
                'message': 'No interface defined for URL.'
            })
            return response, 404

        DB_SESSION.delete(project)
        DB_SESSION.commit()

        return jsonify({'project': project.serialize})