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

Fixed #2761 - ListField truncation on HTTP PATCH#3415

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 2 commits intoencode:masterfromadamsc64:issue_2761
Sep 21, 2015

Conversation

@adamsc64
Copy link
Contributor

  • Previously, partial serialization during an update request, such as in the case of HTTP PATCH, would have truncated any old values in ListField data. This is because it had relied on the default value of an empty list. But an empty list has different functionality than the sentinel value ofempty. Namely, the semantic meaning of an empty list on an update is to remove all the values. Instead, this PR changes validation internals to use the sentinel value ofempty instead of an empty list.
  • Included minor refactor of bothListField andMultipleChoiceField, for the sake of consistent code.
  • Included proof of bug in a unit test atcb42b99.
  • Should resolve IssuePATCH with no data is updating ListField values on ModelSerializer instead of leaving them alone #2761.

- When not submitting key for list fields or multiple choice, partial  serialization should result in empty state (key not there), not an  empty list.
- Checked ``partial`` state when getting value in appropriate field  classes; return ``empty`` immediately if key not submitted.
@xordoquyxordoquy added the Bug labelSep 21, 2015
@xordoquyxordoquy added this to the3.2.5 Release milestoneSep 21, 2015
xordoquy added a commit that referenced this pull requestSep 21, 2015
Fixed#2761 - ListField truncation on HTTP PATCH
@xordoquyxordoquy merged commitf2c6551 intoencode:masterSep 21, 2015
@xordoquy
Copy link
Contributor

Good job ! Thanks for the PR.

xordoquy added a commit to linovia/django-rest-framework that referenced this pull requestSep 21, 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.2.4 Release

Development

Successfully merging this pull request may close these issues.

2 participants

@adamsc64@xordoquy

[8]ページ先頭

©2009-2025 Movatter.jp