diff --git a/program/filters.py b/program/filters.py index 41c3a4a53a3b06228d7a224455758b9ef8909dbe..f4abfc6ee87ee8c43c0ca345e1cfbab08b5f8ee7 100644 --- a/program/filters.py +++ b/program/filters.py @@ -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).",