Beispiel #1
0
def do_calculate_hotel_rating(request, response):
    current_index_str = param.get('current_hotel_index')
    if current_index_str == None:
        current_index = 0
    else:    
        current_index = int(current_index_str) + 1
        
    hotels = place.get_hotels()
    if len(hotels) <= current_index:
        current_index = 0
    hotel = hotels[current_index]
    rater.get(hotel)
    
    param.add('current_hotel_index', str(current_index))    
    response.out.write('Processed the rating of hotel ' + hotel.name)
    logging.info('Processed the rating of hotel ' + hotel.name)
Beispiel #2
0
def post_param(request, response):
    name = request.get('name')
    value = request.get('value')
    param.add(name, value)