You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MatchSerializer(serializers.ModelSerializer):
winner = AthleteWinnerSerializer(read_only=True)
class Meta:
model = Match
fields = ['uid', 'round_one', 'round_two', 'round_three', 'winner']
In this example the winner is generated in the body of the post api like the example below :
The text was updated successfully, but these errors were encountered:
SamiTalebian
changed the title
Sho=owing the read_only fields in the serializer in the post /swagger template
Showing the read_only fields in the serializer in the post /swagger template
Dec 3, 2023
SamiTalebian
changed the title
Showing the read_only fields in the serializer in the post /swagger template
Showing the read_only fields in the serializer in the post /swagger template in (ForignKeyFields)
Dec 9, 2023
class MatchSerializer(serializers.ModelSerializer):
winner = AthleteWinnerSerializer(read_only=True)
class Meta:
model = Match
fields = ['uid', 'round_one', 'round_two', 'round_three', 'winner']
In this example the winner is generated in the body of the post api like the example below :
{
"round_one": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"round_two": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"round_three": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"winner": {
"username": "string"
}
}
The text was updated successfully, but these errors were encountered: