Example #1
0
def new_game():
    print("New keywords: " + request.form['keyword'])
    keywords = request.form['keyword']
    city = request.form['city']
    places.new_game(city, keywords)
    locations = places.get_all_locations()
    session['locations'] = jsonpickle.encode(locations)
    session['index'] = 0
    session.modified = True
    return redirect('/')
Example #2
0
def index():
    locations = places.get_all_locations()
    session['locations'] = jsonpickle.encode(locations)
    if locations:
        print(len(locations))

    if not index or locations is None or session['index'] > len(locations):
        return render_template('index.html')
    return render_template('index.html',
                           places=locations[session['index']].name,
                           city=places.get_city())