Пример #1
0
  def get(self):
    session_id = get_session_id(session, request)
    constraint_id = request.args.get('constraint_id', -1)
    coloured = request.args.get('coloured', False)

    dao = GoalDAO(session_id)
    goals = dao.get_goals(constraint_id=constraint_id, coloured=(coloured == '1'))
    dao.close()

    resp = make_response(json_serialize(goals, session_id=session_id))
    resp.headers['Content-Type'] = "application/json"
    return resp
Пример #2
0
    def get(self):
        session_id = get_session_id(session, request)
        constraint_id = request.args.get('constraint_id', -1)
        coloured = request.args.get('coloured', False)

        dao = GoalDAO(session_id)
        goals = dao.get_goals(constraint_id=constraint_id,
                              coloured=(coloured == '1'))
        dao.close()

        resp = make_response(json_serialize(goals, session_id=session_id))
        resp.headers['Content-Type'] = "application/json"
        return resp