From 5dd336ec6ca80dbcabaa1be054ac5a7f2f6c2a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George-Cristian=20B=C3=AErzan?= Date: Wed, 15 Jun 2016 16:35:37 +0300 Subject: [PATCH] #4198: Update documentation with behaviour changes. --- docs/api-guide/serializers.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index 038a4d6b9..48d9723ec 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -532,7 +532,7 @@ This option should be a list or tuple of field names, and is declared as follows fields = ('id', 'account_name', 'users', 'created') read_only_fields = ('account_name',) -Model fields which have `editable=False` set, and `AutoField` fields will be set to read-only by default, and do not need to be added to the `read_only_fields` option. +Model fields which have `editable=False` set, and `AutoField` fields will be set to read-only by default, and do not need to be added to the `read_only_fields` option. Having a field listed in `read_only_fields` and declared on the class will raise an exception. --- @@ -570,6 +570,8 @@ This option is a dictionary, mapping field names to a dictionary of keyword argu user.save() return user +Having arguments for a field in `extra_kwargs` for a field declared on the class will raise an exception. + ## 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.