def get_inital_flight_prices(days=120): dates = get_dates(days) destinations = Destinations.objects.filter(dates=dates)[:1][0] cites = destinations.destinations.all()[:5] for city in cites: print city.name print city.country get_flight_prices(destinations.origin, city, dates)
def update_flight_prices(limit): print "###################" print "###################" print "###################" slices = Slice.objects.all().order_by("price")[:limit] for slice in slices: print slice.origin.name print slice.dates.departure_date print slice.dates.return_date print slice.destination.name get_flight_prices(slice.origin, slice.destination, slice.dates)
def update_flight_prices(limit): print '###################' print '###################' print '###################' slices = Slice.objects.all().order_by('price')[:limit] for slice in slices: print slice.origin.name print slice.dates.departure_date print slice.dates.return_date print slice.destination.name get_flight_prices(slice.origin, slice.destination, slice.dates)