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

feat: add new startsBefore and endsAfter filters for timeslots API

parent 2f4472f8
No related branches found
No related tags found
1 merge request!28refactor timeslot API filters
Pipeline #7216 passed
......@@ -184,6 +184,11 @@ class TimeSlotFilterSet(filters.FilterSet):
"If specified without a datetime value the current date and time is assumed."
),
)
starts_before = filters.DateTimeFilter(
field_name="start",
lookup_expr="lt",
help_text="Only returns timeslots that start before the specified datetime.",
)
starts_after = filters.DateTimeFilter(
field_name="start",
lookup_expr="gte",
......@@ -194,6 +199,11 @@ class TimeSlotFilterSet(filters.FilterSet):
lookup_expr="lt",
help_text="Only returns timeslots that end before the specified datetime.",
)
ends_after = filters.DateTimeFilter(
field_name="end",
lookup_expr="gte",
help_text="Only returns timeslots that end at or after the specified datetime.",
)
schedule_ids = IntegerInFilter(
field_name="schedule",
help_text="Return only timeslots that belong to the specified schedule(s).",
......
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