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
fe22b9ae
Commit
fe22b9ae
authored
1 year ago
by
Chris Pastl
Browse files
Options
Downloads
Patches
Plain Diff
Fix: add PlayoutFilterSet for doc autogen
parent
00bad372
No related branches found
No related tags found
1 merge request
!42
Refactor playout endpoint: add PlayoutFilterSet for doc autogen
Pipeline
#7920
passed
1 year ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
program/filters.py
+25
-0
25 additions, 0 deletions
program/filters.py
program/views.py
+4
-5
4 additions, 5 deletions
program/views.py
with
29 additions
and
5 deletions
program/filters.py
+
25
−
0
View file @
fe22b9ae
...
...
@@ -280,3 +280,28 @@ class ActiveFilterSet(StaticFilterHelpTextMixin, filters.FilterSet):
fields
=
[
"
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
+
4
−
5
View file @
fe22b9ae
...
...
@@ -193,11 +193,7 @@ class APIDayScheduleViewSet(
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.
"
"
Returns a list of the scheduled playout.
"
"
The schedule will include virtual timeslots to fill unscheduled gaps if requested.
"
),
),
...
...
@@ -207,6 +203,9 @@ class APIPlayoutViewSet(
viewsets
.
GenericViewSet
,
):
queryset
=
TimeSlot
.
objects
.
all
()
serializer_class
=
TimeSlotSerializer
filter_backends
=
[
DjangoFilterBackend
]
filterset_class
=
filters
.
PlayoutFilterSet
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