Skip to content
Snippets Groups Projects

Refactor Note REST API endpoint

Merged Konrad Mohrfeldt requested to merge kmohrf/aep05-note-endpoint-refactoring into aep05
1 file
+ 9
1
Compare changes
  • Side-by-side
  • Inline
  • f1d339d8
    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.
+ 9
1
@@ -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):
Loading