Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def save():
- # Get data from FORM
- question1=request.form['antykoncepcja']
- question2=request.form['partnerzy']
- if question2 is None:
- question3 = "-1"
- question4 = "-1"
- else:
- question3 = request.form['sexWiek']
- question4 = request.form['ciaza']
- if question4 is None:
- question5 = "0"
- else:
- question5 = request.form['ciazaWiek']
- #question3=request.form['sexWiek']
- #question4=request.form['ciaza']
- #question5=request.form['ciazaWiek']
- question6 = request.form['cytologia']
- question7 = request.form['palenie']
- question8 = request.form['alkohol']
- question9 = request.form['warzywa']
- question10 = request.form['wf']
- question11 = request.form['chorzySM']
- question12 = request.form['chorzyIN']
- chorzyHPV = request.form['chorzyHPV']
- # if chorzyHPV == "Tak":
- # typHPV = request.form["HPV"]
- # else:
- # typHPV = "-1"
- question13 = request.form['waga']
- question13_2 = request.form['wzrost']
- question14 = request.form['wiek']
- question15 = request.form['miasto']
- question16 = request.form['praca']
- question17 = request.form['wyksztalcenie']
- #pytania warunkowe
- #if question2 == "0":
- # question3 = "0"
- # question4 = "0" #brak dzieci
- # question5 = "0"
- #elif question4 == "0":
- # question5 = "0"
- #funkcja obliczajaca risk factor. zwraca risk factor
- risk = risk_factor_calculate(question1, question2, question3, question4, question5,
- question6, question7, question8, question9, question10,
- question11, question12, question13, question13_2,question14,
- question15, question16, question17, chorzyHPV)
- # Save the data
- fd = Formdata(question1, question2, question3, question4, question5,
- question6, question7, question8, question9, question10,
- question11, question12, question13, question13_2,question14,
- question15, question16, question17, chorzyHPV, risk)
- db.session.add(fd)
- db.session.commit()
- return redirect(url_for('show_result', form_id=fd.id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement