Extract method for manual_fields
processing by carltongibson · Pull Request #5633 · encode/django-rest-framework (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation4 Commits6 Checks0 Files changed
Conversation
This file contains hidden or 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
[ Show hidden characters]({{ revealButtonHref }})
Allows reuse of logic to replace Field instances in a field list by Field.name
.
Adds a utility function for the logic plus a wrapper method on AutoSchema
.
Closes #5632
TODO:
- Add tests
- Documentation
Allows reuse of logic to replace Field instances in a field list by Field.name
.
Adds a utility function for the logic plus a wrapper method on AutoSchema
.
Closes encode#5632
@rpkilby Can you just cast your eye over this please? General approach etc.
I'll add an explicit test on update_fields
but beyond that I was happy to let the existing test cover the method level wrapper. Your thought there?
Ta.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use OrderedDict in inspectors
Move empty check to 'update_fields()'
Make 'update_fields()' an AutoSchema staticmethod
Add 'AutoSchema.get_manual_fields()'
Conform '.get_manual_fields()' to other methods
get_manual_fields
update_fields
OK. I think this is ready to go.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes looks good to get in
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request
- Extract method for
manual_fields
processing
Allows reuse of logic to replace Field instances in a field list by Field.name
.
Adds a utility function for the logic plus a wrapper method on AutoSchema
.
Closes encode#5632
Manual fields suggestions (encode#2)
Use OrderedDict in inspectors
Move empty check to 'update_fields()'
Make 'update_fields()' an AutoSchema staticmethod
Add 'AutoSchema.get_manual_fields()'
Conform '.get_manual_fields()' to other methods
Add test for update_fields
Make sure
manual_fields
is a list.
(As documented to be)
Add docs for new AutoSchema methods.
get_manual_fields
update_fields
Add release notes for PR.