Skip to content
Snippets Groups Projects
Commit c7e65ca9 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

feat(REST): add route-filter alternatives for timeslot endpoint

The nested timeslot routes allowed us to filter the timeslots by show
and schedule. We’ve deprecated nested endpoints with the alpha.2
release, but still need the actual filtering logic.
parent 2cead7a5
No related branches found
No related tags found
No related merge requests found
Pipeline #5650 passed
......@@ -174,6 +174,16 @@ class TimeSlotFilterSet(filters.FilterSet):
),
)
scheduleIds = IntegerInFilter(
field_name="schedule",
help_text="Return only timeslots that belong to the specified schedule(s).",
)
showIds = IntegerInFilter(
field_name="schedule__show",
help_text="Return only timeslots that belong to the specified show(s).",
)
def filter_surrounding(self, queryset: QuerySet, name: str, value: datetime.datetime):
nearest_timeslots_in_future = (
models.TimeSlot.objects.filter(start__gte=value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment