diff options
| author | Tom Christie | 2014-10-09 10:11:44 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-10-09 10:11:44 +0100 | 
| commit | 5f4cc52ef5c0f603420c6ea809594710a372d336 (patch) | |
| tree | 6964e34d3820842fae84b8ca8c0f3920fcfc6c7c /rest_framework/validators.py | |
| parent | a58cfe167d837d34994b50f52098c552f6b0860e (diff) | |
| download | django-rest-framework-5f4cc52ef5c0f603420c6ea809594710a372d336.tar.bz2 | |
Tweaking
Diffstat (limited to 'rest_framework/validators.py')
| -rw-r--r-- | rest_framework/validators.py | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/rest_framework/validators.py b/rest_framework/validators.py index 5bb69ad8..f76faaa4 100644 --- a/rest_framework/validators.py +++ b/rest_framework/validators.py @@ -12,6 +12,9 @@ from rest_framework.utils.representation import smart_repr  class UniqueValidator: +    """ +    Validator that corresponds to `unique=True` on a model field. +    """      # Validators with `requires_context` will have the field instance      # passed to them when the field is instantiated.      requires_context = True @@ -46,6 +49,9 @@ class UniqueValidator:  class UniqueTogetherValidator: +    """ +    Validator that corresponds to `unique_together = (...)` on a model class. +    """      requires_context = True      message = _('The fields {field_names} must make a unique set.') | 
