Example #1
0
def call_output():
    # gets the city variable from the linking page
    destination = request.args.get('ID')

    # transform the destination to a more suitable format
    # (i.e. remove state and make all lower case):
    tdest = str(destination).split(',')[0].strip().lower()

    if tdest in available_cities:
        hotel_names, hotel_ratings, hotel_imgs, hotel_urls, hotel_prices = rbh.retrieve_best_hotels3(destination)
        return render_template("output.html",
                               destination=destination, map_name='map4.html', unavailable=False,
                               ratings=zip(hotel_ratings, hotel_names, hotel_imgs, hotel_urls, hotel_prices))
    else:
        return render_template("output.html",
                               destination=destination,
                               unavailable=True,
                               available_cities=available_cities)
Example #2
0
def return_best_hotels():
    hotel_names, hotel_ratings = rbh.retrieve_best_hotels3('Phoenix')
    return 'howdy\n'+('-').join(hotel_names)