From c24eee06ee4c74acdce9b9073594516f8ede57f5 Mon Sep 17 00:00:00 2001 From: Chris Pastl <chris@crispybits.app> Date: Mon, 15 Apr 2024 17:39:03 +0200 Subject: [PATCH] Refactor: add annotations for APIPlayoutViewSet --- program/views.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/program/views.py b/program/views.py index 01245a7f..79406df5 100644 --- a/program/views.py +++ b/program/views.py @@ -171,6 +171,20 @@ def json_day_schedule(request, year=None, month=None, day=None): ) +@extend_schema_view( + create=extend_schema(summary="List playout."), + list=extend_schema( + summary="List scheduled playout.", + description=( + "Returns a list of the scheduled playout." + "Expects parameters `start` (date), `end` (date), and `includeVirtual` (boolean)." + "- `start` is today by default." + "- `end` is one week after the start date by default." + "- `includeVirtual` is false by default." + "The schedule will include virtual timeslots to fill unscheduled gaps if requested." + ), + ), +) class APIPlayoutViewSet( mixins.ListModelMixin, viewsets.GenericViewSet, @@ -180,15 +194,6 @@ class APIPlayoutViewSet( def list(self, request, *args, **kwargs): """ Return a JSON representation of the scheduled playout. - - Expects GET parameters `start` (date), `end` (date), and `includeVirtual` (boolean). - - - `start` is today by default. - - `end` is one week after the start date by default. - - `includeVirtual` is false by default. - - The schedule will include virtual timeslots to fill unscheduled gaps if requested. - Called by - engine (playout) to retrieve timeslots within a given timerange - internal calendar to retrieve all timeslots for a week -- GitLab