Filtering Django REST framework using IN operator
I think there is no inbuilt functionality for that. But you can implement a custom filter to do that. This custom filter you can use in your filterset.
import django_filters as df
class InListFilter(df.Filter):
"""
Expects a comma separated list
filters values in list
"""
def filter(self, qs, value):
if value:
return qs.filter(**{self.name+'__in': value.split(',')})
return qs
class MyFilterSet(df.FilterSet):
status = InListFilter(name='status')