1👍
✅
As the name filtered_fields
hints, it expects a collection of fields, not a single field. You thus should implement this as a list, tuple, set, or any other collection of strings, not a single string:
class StartUpViewSet(NestedViewSetMixin, ModelViewSet):
# …
filterset_fields = ('status',)
If you want to specify a custom FilterSet
, you pass a reference to the class with:
class StartUpViewSet(NestedViewSetMixin, ModelViewSet):
# no filterset_fields
filterset_class = StartupFilter
Source:stackexchange.com