def get(self, id): try: currentRequest = Request.get(id = id) except peewee.DoesNotExist: abort(404, message="Request {} doesn't exist".format(args.request_id)) return currentRequest
def post(self): args = request_parser.parse_args() try: currentRequest = Request.get(id = args.request_id) currentRequest.status = 1 # status: the request is canceled currentRequest.save() except peewee.DoesNotExist: abort(404, message="Request {} doesn't exist".format(args.request_id)) return args.request_id, 200
def post(self): args = request_parser.parse_args() try: currentRequest = Request.get(id = args.request_id) currentRequest.current_latitude = args.current_latitude currentRequest.current_longitude = args.current_longitude currentRequest.save() except peewee.DoesNotExist: abort(404, message="Request {} doesn't exist".format(args.request_id)) return currentRequest.id, 200
def post(self): args = request_parser.parse_args() try: currentRequest = Request.get(id = args.request_id) currentRequest.status = 6 # status: the request is closed currentRequest.board_price = args.end_price_estimate currentRequest.product = args.product_id currentRequest.save() except peewee.DoesNotExist: abort(404, message="Request {} doesn't exist".format(args.request_id)) return args.request_id, 200