-
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
Improve view-related attribute name consistency #867
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #867 +/- ##
==========================================
- Coverage 98.25% 98.12% -0.13%
==========================================
Files 15 15
Lines 1144 1176 +32
==========================================
+ Hits 1124 1154 +30
- Misses 20 22 +2
Continue to review full report at Codecov.
|
auvipy
approved these changes
Mar 13, 2018
Based on 'django.utils.deprecation.RenameAttributesBase'.
- FilterMixin.filter_fields => filterset_fields - Backend.default_filter_set => filterset_base - Backend.get_filter_class => get_filterset_class
- ViewSet.filter_class => filterset_class - ViewSet.filter_fields => filterset_fields
carltongibson
force-pushed
the
view-renames
branch
from
July 13, 2018 08:47
ce8cd9d
to
6c1d318
Compare
This was referenced Apr 4, 2019
mpw5
added a commit
to ministryofjustice/laa-fee-calculator
that referenced
this pull request
Oct 25, 2022
django-filter renamed filter_class to filterset_class some time ago: carltongibson/django-filter#867. The deprecated method name remained valid until v22 but now results in failures. This commit renames all occurences of filter_class to filterset_class.
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Separating out the attribute renaming from #865, since getting the deprecations to work correctly required a bit of work. This required some utility code:
RenameMethodsBase
metaclass, fromdjango.utils.deprecation
RenameAttributesBase
metaclass (based onRenameMethodsBase
)MigrationNotice
exception, which inherits fromDeprecationWarning
. This integrates with the above metaclass designs, and allows us to use migration exceptions instead of standard assertions.Here are the various attribute renames... thoughts?
ViewSet.filter_class
=>filterset_class
ViewSet.filter_fields
=>filterset_fields
DjangoFilterBackend.default_filter_set
=>filterset_base
DjangoFilterBackend.get_filter_class()
=>get_filterset_class()
FilterMixin.filter_fields
=>filterset_fields
Submitting the changes first without the updated tests, to help demonstrate that the metaclasses work.