Can i validate filter params using django-filters with some exeption if params or filter-params are wrong?

I incapsulate some logic for inheritance to for drf views. If i am using wrong field-param or wrong fild-filter (for example param with filter is: ?title__contains=title, and on frontend we made some mistake), i just get Model.objects.all() query from self.filter_queryset without any exception, but i gues that django-filter validate params inside filter_queryset method. I will be very grateful for the hints in which direction I need to look.

Hear i'm using django-filters:

class SomeView(GenericAPIView):
    filter_backends = [DjangoFilterBackend]
    some = SomeDTO()
    def some_get(self, request: Request, serializer: serializers):
        model = serializer.Meta.model
        params = request.query_params
        if params:
            query = self.filter_queryset(model.objects.all()) # problem is hear!
            query = model.objects.all()
        self.some.collect(serializer(query, many=True).data, status.HTTP_200_OK)
        return self.uni

Drf-views looks like:

class CurrentView(SomeView):
    filterset_class = CustomerFilter

    def get(self, request: Request):
        some: SomeDTO = self.some_get(request, CurrentSerializerDepth)
        return Response(, some.status)

    def post(self, request: Request):
        some: SomeDTO = self.some_create_or_update(request, CurrentSerializerFlat)
        return Response(, some.status) 
Back to Top