Пример #1
0
    def getFullItineraryDetails(self, itinerary_id):
        result = self.dao.getFullItineraryDetails(itinerary_id)

        if not result:
            return jsonify(Error="Itinerary Not Found"), 404
        else:
            itinerary = itineraryRepository(result)
            itinerary = getInfo(itinerary)
            return jsonify(Itinerary=itinerary)
Пример #2
0
    def getItinerariesByRouteId(self, route_id):
        result = self.dao.getItinerariesByRouteId(route_id)

        if not result:
            return jsonify(Error="Itinerary Not Found"), 404
        else:
            itinerary = itineraryRepository(result)
            itinerary = getInfo(itinerary)
            return jsonify(Itinerary=itinerary)
Пример #3
0
    def getItinerariesByEndTime(self, end_time):
        result_list = self.dao.getItinerariesByEndTime(end_time)
        itinerary_list = []

        if not result_list:
            return jsonify(Error="Itineraries Not Found"), 404
        else:
            itinerary_list = itineraryRepository(result_list)
            itinerary_list = list(map(getInfo, itinerary_list))
            return jsonify(Itineraries=itinerary_list)
Пример #4
0
    def getItinerariesByDriverId(self, driver_id):
        result_list = self.dao.getItinerariesByDriverId(driver_id)
        itinerary_list = []

        if not result_list:
            return jsonify(Error="Itineraries Not Found"), 404
        else:
            itinerary_list = itineraryRepository(result_list)
            itinerary_list = list(map(getInfo, itinerary_list))
            return jsonify(Itineraries=itinerary_list)
Пример #5
0
    def getAllItineraries(self):
        result_list = self.dao.getAllItineraries()
        itinerary_list = []
        '''
        for row in result_list:
            itinerary = Itinerary(row)
            result = itinerary.itineraryInfo()
            itinerary_list.append(result)
        '''
        itinerary_list = itineraryRepository(result_list)
        itinerary_list = list(map(getInfo, itinerary_list))

        return jsonify(Itineraries=itinerary_list)