def get_vehicules(): response = app.response_class( response=json.dumps(myp.get_vehicles(), default=lambda car: car.to_dict()), status=200, mimetype='application/json' ) return response
def get_vehicle_info(vin): response = app.response_class( response=json.dumps(myp.get_vehicle_info(vin).to_dict(), default=str), status=200, mimetype='application/json' ) return response
def get_vehicle_info(vin): from_cache = int(request.args.get('from_cache', 0)) == 1 response = app.response_class(response=json.dumps( CONFIG.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str), status=200, mimetype='application/json') return response