move minutes_to_string into report_generator.py
This commit is contained in:
parent
5e11292a60
commit
d7c64c875c
2 changed files with 9 additions and 8 deletions
|
|
@ -174,14 +174,6 @@ class FormData:
|
|||
|
||||
return models.SpecificInterval(tuple(present_intervals))
|
||||
|
||||
def minutes_to_string(self, minutes: int) -> str:
|
||||
minute_string = str(minutes % 60)
|
||||
minute_string = "0" * (2 - len(minute_string)) + minute_string
|
||||
hour_string = str(minutes // 60)
|
||||
hour_string = "0" * (2 - len(hour_string)) + hour_string
|
||||
|
||||
return f"{hour_string}:{minute_string}"
|
||||
|
||||
|
||||
def model_from_form(form: FormData, tmp_raw_form_data) -> models.Model:
|
||||
d = tmp_raw_form_data
|
||||
|
|
|
|||
|
|
@ -69,6 +69,15 @@ def plot(times, concentrations):
|
|||
return fig
|
||||
|
||||
|
||||
def minutes_to_string(minutes: int) -> str:
|
||||
minute_string = str(minutes % 60)
|
||||
minute_string = "0" * (2 - len(minute_string)) + minute_string
|
||||
hour_string = str(minutes // 60)
|
||||
hour_string = "0" * (2 - len(hour_string)) + hour_string
|
||||
|
||||
return f"{hour_string}:{minute_string}"
|
||||
|
||||
|
||||
def build_report(model: models.Model, form: FormData):
|
||||
now = datetime.now()
|
||||
time = now.strftime("%d/%m/%Y %H:%M:%S")
|
||||
|
|
|
|||
Loading…
Reference in a new issue