Various improvements
This commit is contained in:
parent
a8e0bd39e5
commit
2090268754
3 changed files with 13 additions and 12 deletions
9
app.py
9
app.py
|
|
@ -33,6 +33,15 @@ def index():
|
|||
return render_template('index.html', destinations=DESTINATIONS, today=today)
|
||||
|
||||
|
||||
@app.route('/search')
|
||||
def search():
|
||||
slug = request.args.get('destination', '')
|
||||
travel_date = request.args.get('travel_date', '')
|
||||
if slug in DESTINATIONS and travel_date:
|
||||
return redirect(url_for('results', slug=slug, travel_date=travel_date))
|
||||
return redirect(url_for('index'))
|
||||
|
||||
|
||||
@app.route('/results/<slug>/<travel_date>')
|
||||
def results(slug, travel_date):
|
||||
destination = DESTINATIONS.get(slug)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue