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

feat: implement show and timeslot filters

This is mainly so we can start phasing out nested routes.
With nested routes objects were filtered based on route parameters.
Therefore we need something similar in the form of query parameters.
parent ab3e6406
No related branches found
No related tags found
1 merge request!25Refactor Note REST API endpoint
......@@ -231,6 +231,14 @@ class TimeSlotFilterSet(filters.FilterSet):
class NoteFilterSet(StaticFilterHelpTextMixin, filters.FilterSet):
show = IntegerInFilter(
field_name="timeslot__show",
help_text="Return only notes that belong to the specified show(s).",
)
timeslot = IntegerInFilter(
field_name="timeslot",
help_text="Return only notes that belong to the specified timeslot(s).",
)
ids = IntegerInFilter(
field_name="id",
help_text="Return only notes matching the specified id(s).",
......@@ -245,7 +253,7 @@ class NoteFilterSet(StaticFilterHelpTextMixin, filters.FilterSet):
help_texts = {
"owner": "Return only notes created by the specified user.",
}
fields = ["ids", "owner", "show_owner"]
fields = ["ids", "owner", "show", "timeslot", "show_owner"]
class ActiveFilterSet(StaticFilterHelpTextMixin, filters.FilterSet):
......
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