Exemple #1
0
        def temperature():
            # TODO request shouldn't be forwarded to application code
            temp = Temperature(request)

            if request.args.get("accuracy"):
                temp.set_accuracy(int(request.args.get("accuracy")))

            # TODO db_session is temporary here
            if request.method == 'GET':
                return temp.process_get(self.db_session)
            elif request.method == 'POST':
                return temp.process_post(self.db_session)