Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
56140d88
Commit
56140d88
authored
9 months ago
by
Chris Pastl
Browse files
Options
Downloads
Patches
Plain Diff
fix: auto-gen doc params
parent
087a9385
No related branches found
No related tags found
1 merge request
!45
Refactor playout endpoint: fix auto-gen doc params
Pipeline
#8162
passed
9 months ago
Stage: check
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
program/filters.py
+22
-0
22 additions, 0 deletions
program/filters.py
program/views.py
+5
-5
5 additions, 5 deletions
program/views.py
with
27 additions
and
5 deletions
program/filters.py
+
22
−
0
View file @
56140d88
...
@@ -280,3 +280,25 @@ class ActiveFilterSet(StaticFilterHelpTextMixin, filters.FilterSet):
...
@@ -280,3 +280,25 @@ class ActiveFilterSet(StaticFilterHelpTextMixin, filters.FilterSet):
fields
=
[
fields
=
[
"
is_active
"
,
"
is_active
"
,
]
]
class
PlayoutFilterSet
(
filters
.
FilterSet
):
start
=
filters
.
DateFilter
(
field_name
=
"
start
"
,
lookup_expr
=
"
gte
"
,
help_text
=
"
Returns timeslots that start at or after the specified datetime
"
"
(default: today).
"
,
)
end
=
filters
.
DateFilter
(
field_name
=
"
end
"
,
lookup_expr
=
"
lte
"
,
help_text
=
"
Returns timeslots that end at or before the specified datetime
"
"
(default: one week after start date).
"
,
)
include_virtual
=
filters
.
BooleanFilter
(
field_name
=
"
include_virtual
"
,
help_text
=
"
Include virtual timeslots (default: false).
"
)
class
Meta
:
model
=
models
.
TimeSlot
fields
=
[
"
start
"
,
"
end
"
,
"
include_virtual
"
]
This diff is collapsed.
Click to expand it.
program/views.py
+
5
−
5
View file @
56140d88
...
@@ -157,6 +157,7 @@ class APIDayScheduleViewSet(
...
@@ -157,6 +157,7 @@ class APIDayScheduleViewSet(
viewsets
.
GenericViewSet
,
viewsets
.
GenericViewSet
,
):
):
queryset
=
TimeSlot
.
objects
.
all
()
queryset
=
TimeSlot
.
objects
.
all
()
serializer_class
=
TimeSlotSerializer
def
list
(
self
,
request
,
year
=
None
,
month
=
None
,
day
=
None
):
def
list
(
self
,
request
,
year
=
None
,
month
=
None
,
day
=
None
):
# datetime.combine returns a timezone naive datetime object
# datetime.combine returns a timezone naive datetime object
...
@@ -187,11 +188,7 @@ class APIDayScheduleViewSet(
...
@@ -187,11 +188,7 @@ class APIDayScheduleViewSet(
list
=
extend_schema
(
list
=
extend_schema
(
summary
=
"
List scheduled playout.
"
,
summary
=
"
List scheduled playout.
"
,
description
=
(
description
=
(
"
Returns a list of the scheduled playout.
"
"
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.
"
"
The schedule will include virtual timeslots to fill unscheduled gaps if requested.
"
),
),
),
),
...
@@ -201,6 +198,9 @@ class APIPlayoutViewSet(
...
@@ -201,6 +198,9 @@ class APIPlayoutViewSet(
viewsets
.
GenericViewSet
,
viewsets
.
GenericViewSet
,
):
):
queryset
=
TimeSlot
.
objects
.
all
()
queryset
=
TimeSlot
.
objects
.
all
()
serializer_class
=
TimeSlotSerializer
filter_backends
=
[
DjangoFilterBackend
]
filterset_class
=
filters
.
PlayoutFilterSet
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment