Merge pull request #6588 from rawteech/master

Add some words about `extra_kwargs` and explicitly defined fields.
This commit is contained in:
Xavier Ordoquy 2019-04-15 02:31:07 +02:00 committed by GitHub
commit db65282163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,6 +572,8 @@ This option is a dictionary, mapping field names to a dictionary of keyword argu
user.save() user.save()
return user return user
Please keep in mind that, if the field has already been explicitly declared on the serializer class, then the `extra_kwargs` option will be ignored.
## Relational fields ## Relational fields
When serializing model instances, there are a number of different ways you might choose to represent relationships. The default representation for `ModelSerializer` is to use the primary keys of the related instances. When serializing model instances, there are a number of different ways you might choose to represent relationships. The default representation for `ModelSerializer` is to use the primary keys of the related instances.