django-url-filter
django-url-filter copied to clipboard
CoreAPIURLFilterBackend causing recursion depth exceeded
Hello,
I tried to use CoreAPIURLFilterBackend to have the filters parameters showing up in our swagger documentation, but I have an errormaximum recursion depth exceeded
when trying to access the documentation url.
It comes from:
/url_filter/integrations/drf_coreapi.py" in _all_filters
60. for i in _all_filters(field, prefix=prefix + (name,)):
ModelViewSet is as such:
class ViewSet(ModelViewSet):
filter_backends = [CoreAPIURLFilterBackend]
filter_fields = ("id", "start_date", "status", "created_at", "updated_at")
pagination_class = LargeResultSetPagination
permission_classes = (permissions.IsAuthenticated)
serializer_class = ViewSetSerializer
I tried this configuration but it would not fix it.
Django==2.2.9
django-url-filter==0.3.14
Would you have some ideas how to solve this issue? Thank you very much.
dont think I have tested core api when viewset defines filterset. have you tried creating filterset explicitly?
Yes, and I run into the same problem. Do you have any ideas?
hmm. usually worked for me. probably there is some edge case with some relations where it attempts to go in infinite loop.
Goes into a infinite loop if a reference field is included in the FilterSet. @miki725 do you think it is simple to fix?
Run into the same issue, but did not had the time to look into thoroughly.
By the way i think that is because allow_related_reverse
True by default: if a model has "circular" relations, this issue comes in.
Hope to have the time to look for a solution this weekend.