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 docs typo in Serializers Validators#9563

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
auvipy merged 1 commit intoencode:masterfromcheehong1030:master
Oct 23, 2024

Conversation

cheehong1030
Copy link
Contributor

Description

Pull Request Description

Fix: Correct example for UniqueTogetherValidator in serializer documentation

The example provided for usingUniqueTogetherValidator in the serializer documentation currently uses anIntegerField for theroom_number field. This is incorrect, asUniqueTogetherValidator is designed to work with relational fields, not integer fields.

This pull request replaces theIntegerField with aChoiceField for theroom_number field, which is a more appropriate field type for this scenario. This change ensures that the example accurately demonstrates how to useUniqueTogetherValidator with related fields.

Changes Made:

  • In the example code snippet, theroom_number field has been changed from:
    room_number=serializers.IntegerField(choices=[101,102,103,201])
    to:
    room_number=serializers.ChoiceField(choices=[101,102,103,201])

This minor correction will help users understand how to properly implementUniqueTogetherValidator in their serializers.

room_number = serializers.IntegerField(choices=[101, 102, 103, 201])

@auvipyauvipy merged commit9016efe intoencode:masterOct 23, 2024
8 checks passed
@browniebrokebrowniebroke added this to the3.16 milestoneJan 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@auvipyauvipyauvipy approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
3.16
Development

Successfully merging this pull request may close these issues.

3 participants
@cheehong1030@auvipy@browniebroke

[8]ページ先頭

©2009-2025 Movatter.jp