Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. def save():
  2. # Get data from FORM
  3. question1=request.form['antykoncepcja']
  4. question2=request.form['partnerzy']
  5. if question2 is None:
  6. question3 = "-1"
  7. question4 = "-1"
  8. else:
  9. question3 = request.form['sexWiek']
  10. question4 = request.form['ciaza']
  11. if question4 is None:
  12. question5 = "0"
  13. else:
  14. question5 = request.form['ciazaWiek']
  15.  
  16. #question3=request.form['sexWiek']
  17. #question4=request.form['ciaza']
  18. #question5=request.form['ciazaWiek']
  19. question6 = request.form['cytologia']
  20. question7 = request.form['palenie']
  21. question8 = request.form['alkohol']
  22. question9 = request.form['warzywa']
  23. question10 = request.form['wf']
  24. question11 = request.form['chorzySM']
  25. question12 = request.form['chorzyIN']
  26. chorzyHPV = request.form['chorzyHPV']
  27.  
  28. # if chorzyHPV == "Tak":
  29. # typHPV = request.form["HPV"]
  30. # else:
  31. # typHPV = "-1"
  32.  
  33. question13 = request.form['waga']
  34. question13_2 = request.form['wzrost']
  35. question14 = request.form['wiek']
  36. question15 = request.form['miasto']
  37. question16 = request.form['praca']
  38. question17 = request.form['wyksztalcenie']
  39.  
  40. #pytania warunkowe
  41. #if question2 == "0":
  42. # question3 = "0"
  43. # question4 = "0" #brak dzieci
  44. # question5 = "0"
  45. #elif question4 == "0":
  46. # question5 = "0"
  47.  
  48.  
  49.  
  50.  
  51. #funkcja obliczajaca risk factor. zwraca risk factor
  52. risk = risk_factor_calculate(question1, question2, question3, question4, question5,
  53. question6, question7, question8, question9, question10,
  54. question11, question12, question13, question13_2,question14,
  55. question15, question16, question17, chorzyHPV)
  56. # Save the data
  57. fd = Formdata(question1, question2, question3, question4, question5,
  58. question6, question7, question8, question9, question10,
  59. question11, question12, question13, question13_2,question14,
  60. question15, question16, question17, chorzyHPV, risk)
  61. db.session.add(fd)
  62. db.session.commit()
  63.  
  64.  
  65. return redirect(url_for('show_result', form_id=fd.id))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement