diff options
| author | Tom Christie | 2014-09-29 09:24:03 +0100 |
|---|---|---|
| committer | Tom Christie | 2014-09-29 09:24:03 +0100 |
| commit | 43fd5a873051c99600386c1fdc9fa368edeb6eda (patch) | |
| tree | 6242d6480b7780c8a9ab2e5c46f1a8b9d0e25676 /rest_framework/fields.py | |
| parent | ce04d59a53df45715c4805831406b2105c9594a8 (diff) | |
| download | django-rest-framework-43fd5a873051c99600386c1fdc9fa368edeb6eda.tar.bz2 | |
Uniqueness validation
Diffstat (limited to 'rest_framework/fields.py')
| -rw-r--r-- | rest_framework/fields.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py index f4b53279..231f693c 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -150,6 +150,10 @@ class Field(object): messages.update(error_messages or {}) self.error_messages = messages + for validator in validators: + if getattr(validator, 'requires_context', False): + validator.serializer_field = self + def bind(self, field_name, parent): """ Initializes the field name and parent for the field instance. |
