Commit 35e3e5e8d3ba9ce5d7985c30e84f93c0488c5e2f
1 parent
d9d606b4
Exists in
master
Add the select field to the form,
to choose the minimum distance for flying.
Showing
1 changed file
with
14 additions
and
0 deletions
Show diff stats
flaskr/forms.py
@@ -3,6 +3,7 @@ from wtforms import \ | @@ -3,6 +3,7 @@ from wtforms import \ | ||
3 | StringField, \ | 3 | StringField, \ |
4 | PasswordField, \ | 4 | PasswordField, \ |
5 | TextAreaField, \ | 5 | TextAreaField, \ |
6 | + SelectField, \ | ||
6 | BooleanField | 7 | BooleanField |
7 | from wtforms import validators | 8 | from wtforms import validators |
8 | 9 | ||
@@ -56,6 +57,19 @@ class EstimateForm(FlaskForm): | @@ -56,6 +57,19 @@ class EstimateForm(FlaskForm): | ||
56 | validators.Length(max=1024), | 57 | validators.Length(max=1024), |
57 | ], | 58 | ], |
58 | ) | 59 | ) |
60 | + use_train_below_km = SelectField( | ||
61 | + label=form_content['use_train_below_km']['label'], | ||
62 | + description=form_content['use_train_below_km']['description'], | ||
63 | + default=300, | ||
64 | + choices=[ | ||
65 | + (0, 'Do not use train'), | ||
66 | + (300, '300 km'), | ||
67 | + (500, '500 km'), | ||
68 | + (700, '700 km'), | ||
69 | + (1000, '1000 km'), | ||
70 | + ], | ||
71 | + coerce=int, | ||
72 | + ) | ||
59 | comment = TextAreaField( | 73 | comment = TextAreaField( |
60 | label=form_content['comment']['label'], | 74 | label=form_content['comment']['label'], |
61 | description=form_content['comment']['description'], | 75 | description=form_content['comment']['description'], |