def flightapi(request): # #sourcestate = request.GET['sourcestate'] # #destinationstate = request.GET['destinationstate'] flightrequest = flightutil.getflightrequestparams(request) resultjsondata = flightcontroller.getresults(flightrequest.sourcecity, flightrequest.destinationcity, flightrequest.journeydate, flightrequest.trainclass, flightrequest.flightclass, flightrequest.numberofadults) return HttpResponse(json.dumps(resultjsondata), content_type='application/json')
def flightdirectandnearapi(request): """ To fetch flight journey between source & destination via nearest airports :param request: http request :return: flight journey between source & destination """ flightrequest = flightutil.getflightrequestparams(request) resultjsondata = flightdirectandnearcontroller.getresults(flightrequest.sourcecity, flightrequest.destinationcity, flightrequest.journeydate, flightrequest.trainclass, flightrequest.flightclass, flightrequest.numberofadults) return HttpResponse(json.dumps(resultjsondata), content_type='application/json')