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 NotImplementedError message: Field to_internal_value and to_representation #6996

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

JEphron
Copy link
Contributor

@JEphron JEphron commented Oct 16, 2019

Description

If you don't implementto_representation in your Field subclass, you get a friendly error message suggesting that you might want to subclass ReadOnlyField instead. However, by not implementing to_representation you would have effectively made the field write_only, so the error message would be misleading (unless I'm horribly mixed up for some reason. Feel free to tell me that my head is on backwards :D)

Also making sure both errors have the field name for consistency's sake.

@rpkilby rpkilby added this to the 3.11 Release milestone Oct 21, 2019
@tomchristie
Copy link
Member

Thanks!

@tomchristie tomchristie merged commit 3c1428f into encode:master Dec 12, 2019
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
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.

None yet

3 participants