forked from harrypotter0/breast-cancer-classifier
-
Notifications
You must be signed in to change notification settings - Fork 1
/
controller.py
56 lines (46 loc) · 1.95 KB
/
controller.py
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 model import InputForm
from flask import Flask, render_template, request
from compute import compute
app = Flask(__name__)
@app.route('/')
def index():
# form = InputForm(request.form)
# if request.method == 'POST' and form.validate():
# result = compute(form.a.data, form.b.data,form.c.data, form.d.data,form.e.data,form.z.data,form.g.data,form.h.data,form.i.data)
# else:
# result = None
return render_template('header.html')
@app.route('/home/')
def home():
# form = InputForm(request.form)
# if request.method == 'POST' and form.validate():
# result = compute(form.a.data, form.b.data,form.c.data, form.d.data,form.e.data,form.z.data,form.g.data,form.h.data,form.i.data)
# else:
# result = None
return render_template('home.html')
@app.route('/usingdata/', methods=['GET', 'POST'])
def usingdata():
form = InputForm(request.form)
if request.method == 'POST' and form.validate():
result = compute(form.a.data, form.b.data,form.c.data, form.d.data,form.e.data,form.z.data,form.g.data,form.h.data,form.i.data)
else:
result = None
return render_template('usingdata.html', form=form, result=result)
@app.route('/moreinfo/')
def moreinfo():
# form = InputForm(request.form)
# if request.method == 'POST' and form.validate():
# result = compute(form.a.data, form.b.data,form.c.data, form.d.data,form.e.data,form.z.data,form.g.data,form.h.data,form.i.data)
# else:
# result = None
return render_template('moreinfo.html')
@app.route('/preventivemeasures/')
def preventivemeasures():
# form = InputForm(request.form)
# if request.method == 'POST' and form.validate():
# result = compute(form.a.data, form.b.data,form.c.data, form.d.data,form.e.data,form.z.data,form.g.data,form.h.data,form.i.data)
# else:
# result = None
return render_template('preventivemeasures.html')
if __name__ == '__main__':
app.run(debug = True)