Ejemplo n.º 1
0
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')
Ejemplo n.º 2
0
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')