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

Fix lookups for reverse relationships #915

Merged
merged 5 commits into from
Jul 13, 2018

Conversation

rpkilby
Copy link
Collaborator

@rpkilby rpkilby commented May 21, 2018

Fixes #882.

  • filter_for_field now generates filters for reverse relationships
  • reverse relationships now obey FILTER_DEFAULTS/Meta.filter_overrides
  • reverse relationships now generate filters for non-exact lookups (eg, isnull)
  • added removal notice/assertion for users that implement filter_for_reverse_field

@codecov-io
Copy link

codecov-io commented May 21, 2018

Codecov Report

Merging #915 into master will decrease coverage by 0.39%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #915     +/-   ##
=========================================
- Coverage   98.33%   97.94%   -0.4%     
=========================================
  Files          15       15             
  Lines        1204     1121     -83     
=========================================
- Hits         1184     1098     -86     
- Misses         20       23      +3
Impacted Files Coverage Δ
django_filters/filterset.py 100% <100%> (ø) ⬆️
django_filters/utils.py 99.02% <0%> (-0.98%) ⬇️
django_filters/filters.py 98.42% <0%> (-0.97%) ⬇️
django_filters/rest_framework/filterset.py 100% <0%> (ø) ⬆️
django_filters/fields.py 100% <0%> (ø) ⬆️
django_filters/views.py 100% <0%> (ø) ⬆️
django_filters/rest_framework/filters.py 100% <0%> (ø) ⬆️
django_filters/rest_framework/backends.py 94.82% <0%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69de18f...a395d13. Read the comment docs.

@rpkilby rpkilby force-pushed the reverse-filter branch 4 times, most recently from c33d82d to 3516b8c Compare May 21, 2018 09:07
Copy link
Owner

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Great. 👍

@carltongibson carltongibson merged commit 195aafd into carltongibson:master Jul 13, 2018
@carltongibson carltongibson added this to the Version 2.0 milestone Jul 13, 2018
@rpkilby rpkilby deleted the reverse-filter branch July 13, 2018 13:12
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

Successfully merging this pull request may close these issues.

3 participants