def filter_queryset(self, request, queryset, view):
        fields = set(view.get_api_fields(queryset.model)).union({'id'})

        for field_name, value in request.GET.items():
            if field_name in fields:
                field = getattr(queryset.model, field_name, None)

                if isinstance(field, _TaggableManager):
                    for tag in value.split(','):
                        queryset = queryset.filter(**{field_name + '__name': tag})

                    # Stick a message on the queryset to indicate that tag filtering has been performed
                    # This will let the do_search method know that it must raise an error as searching
                    # and tag filtering at the same time is not supported
                    queryset._filtered_by_tag = True
                else:
                    queryset = queryset.filter(**{field_name: value})

        return queryset
compute a real nth-root of a sum of surds
dataset/ETHPy150Open torchbox/wagtail/wagtail/contrib/wagtailapi/filters.py/FieldsFilter.filter_queryset--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/simplify/simplify.py/nthroot