Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix nested serializers withunique_together relations.#2975

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
xordoquy merged 4 commits intoencode:masterfromsheppard:read-only-nested
Jun 1, 2015

Conversation

@sheppard
Copy link
Contributor

I came across an unexpected issue when trying to create a read-only nested serializer for a related field that's part of aunique_together constraint (invera). Anextra_kwargs entry ofrequired=True is set for the constraint, but that conflicts withread_only=True set as the nested field'skwargs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You'll likely want a slightly different representation for python 2.7.
Seehttps://github.com/sheppard/django-rest-framework/blob/read-only-nested/tests/test_model_serializer.py#L172 for example.

@xordoquy
Copy link
Contributor

The python 2.7 compatibility put appart, this looks good to me.

@xordoquyxordoquy added the Bug labelMay 28, 2015
@xordoquyxordoquy added this to the2.4.6 Release milestoneMay 28, 2015
@sheppard
Copy link
ContributorAuthor

Ok, I think I got it now, thanks for the tip.

@lovelydinosaur
Copy link
Contributor

Confused - this is Milestoned as 2.4.6, but a pull request against master?

@xordoquy
Copy link
Contributor

@tomchristie my bad

@xordoquy
Copy link
Contributor

Perfect. I ensured the test failed without the correction.
Thanks for the fix.

xordoquy added a commit that referenced this pull requestJun 1, 2015
can't create nested serializers for unique_together relations
@xordoquyxordoquy merged commite3f856f intoencode:masterJun 1, 2015
@xordoquyxordoquy changed the titlecan't create nested serializers for unique_together relationsFix nested serializers withunique_together relations.Jun 1, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

3.1.3 Release

Development

Successfully merging this pull request may close these issues.

3 participants

@sheppard@xordoquy@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp