1👍
✅
Use a FilterSet
class to create a filter with custom filters.
class ExpiredOrderFilter(filters.FilterSet):
created_at__date = filters.DateFilter(field_name='created_at__date')
class Meta:
model = ExpiredOrder
fields = ['created_at',]
Now instead of filterset_fields
user filterset_class
filter_backends = [DjangoFilterBackend]
filterset_class = ExpiredOrderFilter
Source:stackexchange.com