diff options
| author | Tom Christie | 2014-11-13 19:28:57 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-11-13 19:28:57 +0000 | 
| commit | ea98de9b889173235a908ee2ce5a2aba5d8223c7 (patch) | |
| tree | 0ef008f76582c86c166191748b00406c42fd053a /docs | |
| parent | 9e75c4d8eab11d1637d65a8a7683f7970a41111b (diff) | |
| download | django-rest-framework-ea98de9b889173235a908ee2ce5a2aba5d8223c7.tar.bz2 | |
Model fields with .blank or .null now map to required=False. Closes #2017. Closes #2021.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/3.0-announcement.md | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/docs/topics/3.0-announcement.md b/docs/topics/3.0-announcement.md index d3da0607..885fc183 100644 --- a/docs/topics/3.0-announcement.md +++ b/docs/topics/3.0-announcement.md @@ -506,9 +506,9 @@ We now use the following:  REST framework now has more explicit and clear control over validating empty values for fields. -Previously the meaning of the `required=False` keyword argument was underspecified. In practice its use meant that a field could either be not included in the input, or it could be included, but be `None`. +Previously the meaning of the `required=False` keyword argument was underspecified. In practice its use meant that a field could either be not included in the input, or it could be included, but be `None` or the empty string. -We now have a better separation, with separate `required` and `allow_none` arguments. +We now have a better separation, with separate `required`, `allow_none` and `allow_blank` arguments.  The following set of arguments are used to control validation of empty values: @@ -519,7 +519,7 @@ The following set of arguments are used to control validation of empty values:  Typically you'll want to use `required=False` if the corresponding model field has a default value, and additionally set either `allow_none=True` or `allow_blank=True` if required. -The `default` argument is there if you need it, but you'll more typically want defaults to be set on model fields, rather than serializer fields. +The `default` argument is also available and always implies that the field is not required to be in the input. It is unnecessary to use the `required` argument when a default is specified, and doing so will result in an error.  #### Coercing output types. | 
