From 2b9419cebd54f3862f0015c8699ee646c527d4be Mon Sep 17 00:00:00 2001 From: Felix Blanke <info@fblanke.de> Date: Mon, 27 May 2024 09:16:35 +0200 Subject: [PATCH] type hints --- AKModel/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AKModel/models.py b/AKModel/models.py index fe8bb843..4cc9343d 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -196,7 +196,7 @@ class Event(models.Model): yield current_block - def time_slot(self, *, time_slot_index, slots_in_an_hour=1.0): + def time_slot(self, *, time_slot_index: int, slots_in_an_hour: float = 1.0) -> "Availability": from AKModel.availability.models import Availability slot_duration = timedelta(hours=(1.0 / slots_in_an_hour)) @@ -206,7 +206,7 @@ class Event(models.Model): start=start, end=start + slot_duration) - def schedule_from_json(self, schedule): + def schedule_from_json(self, schedule: str) -> None: schedule = json.loads(schedule) slots_in_an_hour = schedule["input"]["timeslots"]["info"]["duration"] -- GitLab