Fix nested serializers with unique_together relations.#2975
Merged
xordoquy merged 4 commits intoencode:masterfrom Jun 1, 2015
Merged
Fix nested serializers with unique_together relations.#2975xordoquy merged 4 commits intoencode:masterfrom
unique_together relations.#2975xordoquy merged 4 commits intoencode:masterfrom
Conversation
tests/test_model_serializer.py
Outdated
Contributor
There was a problem hiding this comment.
You'll likely want a slightly different representation for python 2.7.
See https://github.com/sheppard/django-rest-framework/blob/read-only-nested/tests/test_model_serializer.py#L172 for example.
Contributor
|
The python 2.7 compatibility put appart, this looks good to me. |
Contributor
Author
|
Ok, I think I got it now, thanks for the tip. |
Contributor
|
Confused - this is Milestoned as 2.4.6, but a pull request against master? |
Contributor
|
@tomchristie my bad |
Contributor
|
Perfect. I ensured the test failed without the correction. |
xordoquy
added a commit
that referenced
this pull request
Jun 1, 2015
can't create nested serializers for unique_together relations
unique_together relations.
This was referenced Mar 9, 2017
This was referenced Oct 16, 2017
This was referenced Nov 6, 2017
This was referenced Nov 14, 2017
This was referenced Dec 10, 2017
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
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.
I came across an unexpected issue when trying to create a read-only nested serializer for a related field that's part of a
unique_togetherconstraint (in vera). Anextra_kwargsentry ofrequired=Trueis set for the constraint, but that conflicts withread_only=Trueset as the nested field'skwargs.