Coordinates of each ``location`` passed from the form to the model

This commit is contained in:
Luis Aleixo 2021-08-03 17:56:27 +02:00 committed by jdevine
parent 821fc67c0d
commit 16b056dbd3
3 changed files with 473 additions and 465 deletions

View file

@ -51,6 +51,7 @@ class FormData:
infected_people: int
infected_start: minutes_since_midnight
location: str
location_coordinates: str
mask_type: str
mask_wearing_option: str
mechanical_ventilation_type: str
@ -102,6 +103,7 @@ class FormData:
'infected_people': _NO_DEFAULT,
'infected_start': '08:30',
'location': _NO_DEFAULT,
'location_coordinates': '(46.2044, 6.1432)',
'mask_type': 'Type I',
'mask_wearing_option': 'mask_off',
'mechanical_ventilation_type': 'not-applicable',
@ -604,6 +606,7 @@ def baseline_raw_form_data():
'infected_people': '1',
'infected_start': '09:00',
'location': 'Geneva',
'location_coordinates': '(46.2044, 6.1432)',
'mask_type': 'Type I',
'mask_wearing_option': 'mask_off',
'mechanical_ventilation_type': '',
@ -696,3 +699,4 @@ for _field in dataclasses.fields(FormData):
_CAST_RULES_FORM_ARG_TO_NATIVE[_field.name] = lambda v: v == '1'
_CAST_RULES_NATIVE_TO_FORM_ARG[_field.name] = int

File diff suppressed because it is too large Load diff

View file

@ -109,6 +109,9 @@ v{{ calculator_version }} <span style="float:right; font-weight:bold">Please sen
<label class="col-xl-3 col-lg-4 col-sm-3 col-form-label">Location:</label>
<select id="location_select" class="col-xl-5 col-lg-7 col-sm-7 col-7" name="location" required></select>
</div>
<div class="row" hidden>
<input id="coordinates_input" class="col-xl-5 col-lg-7 col-sm-7 col-7" name="location_coordinates" required></select>
</div>
<hr width="80%">