This repository has been archived by the owner on May 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py.orig
56 lines (49 loc) · 1.56 KB
/
main.py.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from flask import Flask, request, render_template
import fly_cheap
app = Flask(__name__)
<<<<<<< HEAD
@app.route('/')
def form():
return render_template('index.html')
@app.route('/', methods=['POST'])
def form_update():
if request.method == 'POST':
departure = request.form['dept']
destination = request.form['dest']
date = request.form['day']
flights = fly_cheap.find_flights(departure, destination, date)
if flights != 'Invalid Starting Location.' and flights != 'Invalid Destination.' and flights != 'No matching results.':
flights = '\n'.join(flights)
return render_template('index.html', flights = flights)
=======
@app.route('/')
def form():
#flights = '\n'.join(fly_cheap.find_flights('HOU','AUS','2018-12-01'))
return render_template('index.html')
@app.route('/', methods=['POST'])
def form_update():
if request.method == 'POST':
departure = request.form['dept']
destination = request.form['dest']
date = request.form['day']
flights = '\n'.join(fly_cheap.find_flights(departure, destination, date))
return render_template('index.html', flights = flights)
'''
@app.route('/', methods=['POST'])
def handle_data():
if request.method == 'POST':
departure = request.form["dept"]
arrival = request.form["dest"]
date = request.form["day"]
print('{0} {1} {2}'.format(departure, arrival, date))
return departure
'''
'''
@app.route('/')
def show_data():
flights = json_api.find_flights(departure,arrival,date)
print(flights)
'''
>>>>>>> 4efecc3a1ffbf14b8323623401d7b7336a9d975d
if __name__ == '__main__':
app.run(debug=True)