name = self.request.query_params.get('name', None)
if name:
    queryset = queryset.filter(Q(name__icontains=name) | Q(
        abbreviation__icontains=name)).all()
Validation on query_params in Django Rest Framework