Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-filters filter spanning foreign key relationships results in FieldDoesNotExist error #150

Closed
sennierer opened this issue Sep 17, 2020 · 3 comments

Comments

@sennierer
Copy link

sennierer commented Sep 17, 2020

Describe the bug
When using django-filter and adding filters similar to {'FKfield__FKprop': ['exact', 'icontains'}} to the Meta class of a GenericViewset drf-spectacular throws an MODEL has no field named FKfield__FKprop error

Expected behavior
Fields and properties should be splitted similar as django-filter does to follow the FKs to the field that is filtered on

@tfranzel
Copy link
Owner

@sennierer i tried to pull the improvement discussed in #151 into the core and reuse them for django-filter. could you check out the django_filter branch (PR #153) and tell me if that works for you? thanks!

@sennierer
Copy link
Author

Yes, thats working! Thanks for fixing it!

@tfranzel
Copy link
Owner

my pleasure! thanks again for raising the issue and helping to find a good working fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants