diff options
| author | Tom Christie | 2014-11-10 12:21:27 +0000 | 
|---|---|---|
| committer | Tom Christie | 2014-11-10 12:21:27 +0000 | 
| commit | f387cd89da55ef88fcac504f5795ea9b591f3fba (patch) | |
| tree | 3c927d172e0ea18c65f6afd2360c308e286c13a3 /docs | |
| parent | 93633c297c69a1eefda5e153553c4f021cf10bd8 (diff) | |
| download | django-rest-framework-f387cd89da55ef88fcac504f5795ea9b591f3fba.tar.bz2 | |
Uniqueness constraints imply a forced 'required=True'. Refs #1945
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api-guide/validators.md | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/docs/api-guide/validators.md b/docs/api-guide/validators.md index 6a0ef4ff..bb073f57 100644 --- a/docs/api-guide/validators.md +++ b/docs/api-guide/validators.md @@ -93,6 +93,12 @@ The validator should be applied to *serializer classes*, like so:                  )              ] +--- + +**Note**: The `UniqueTogetherValidation` class always imposes an implicit constraint that all the fields it applies to are always treated as required. Fields with `default` values are an exception to this as they always supply a value even when omitted from user input. + +--- +  ## UniqueForDateValidator  ## UniqueForMonthValidator @@ -146,6 +152,10 @@ If you want the date field to be entirely hidden from the user, then use `Hidden  --- +**Note**: The `UniqueFor<Range>Validation` classes always imposes an implicit constraint that the fields they are applied to are always treated as required. Fields with `default` values are an exception to this as they always supply a value even when omitted from user input. + +--- +  # Writing custom validators  You can use any of Django's existing validators, or write your own custom validators. | 
