-
Notifications
You must be signed in to change notification settings - Fork 771
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 Schema warnings #803
Fix Schema warnings #803
Conversation
8752ac7
to
c7e9ecd
Compare
Codecov Report
@@ Coverage Diff @@
## develop #803 +/- ##
==========================================
+ Coverage 97.71% 97.8% +0.08%
==========================================
Files 15 15
Lines 1138 1138
==========================================
+ Hits 1112 1113 +1
+ Misses 26 25 -1
Continue to review full report at Codecov.
|
c7e9ecd
to
d4fa8c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Great.
* Move 'invalid lookup' test to class creation tests * Fix model reference for Filter.label * FilterSet should not require Meta class * Refactor drf backend test views * Add test for Backend.get_filter_class * Fix Backend.get_filter_class * Add Backend.get_schema_fields test for bad fields * Don't suppress TypeErrors in get_schema_fields
* Move 'invalid lookup' test to class creation tests * Fix model reference for Filter.label * FilterSet should not require Meta class * Refactor drf backend test views * Add test for Backend.get_filter_class * Fix Backend.get_filter_class * Add Backend.get_schema_fields test for bad fields * Don't suppress TypeErrors in get_schema_fields
The original purpose of this PR was to fix #802, however it was necessary to make a few other changes.
Changes:
DjangoFilterBackend.get_schema_fields()
no longer catches FilterSet class creation errors (ref Automatic __isnull filter field does not work in django-rest-framework usage #743)DjangoFilterBackend.get_filter_class()
only performs the model check when applicable. The queryset may not have been provided, or thefilter_class
may not have setMeta.model
.Filter.label
has been fixed to referenceself.model
instead ofself.parent._meta.model