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

Extract method for manual_fields processing #5633

Merged

Conversation

carltongibson
Copy link
Collaborator

@carltongibson carltongibson commented Nov 28, 2017

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
@carltongibson carltongibson requested a review from rpkilby Nov 28, 2017
@carltongibson carltongibson added this to the v3.7.4 milestone Nov 28, 2017
@carltongibson
Copy link
Collaborator Author

carltongibson commented Nov 28, 2017

@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.

rpkilby
rpkilby previously requested changes Nov 29, 2017
Copy link
Member

@rpkilby rpkilby left a comment

I've opened carltongibson#2 with suggestions.

* 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
@carltongibson carltongibson dismissed rpkilby’s stale review Dec 1, 2017

Proposed changes merged. Thanks @rpkilby!

@carltongibson carltongibson force-pushed the 374/extract-manual-fields-logic branch from 865fc7d to 7dc903f Compare Dec 1, 2017
@carltongibson
Copy link
Collaborator Author

carltongibson commented Dec 1, 2017

OK. I think this is ready to go.

Copy link
Contributor

@auvipy auvipy left a comment

changes looks good to get in

@carltongibson carltongibson merged commit a0cdba6 into encode:master Dec 4, 2017
1 check passed
@carltongibson carltongibson deleted the 374/extract-manual-fields-logic branch Dec 4, 2017
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this issue Nov 17, 2020
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants