                  validator(value)
              except ValidationError as exc:
                  errors.extend(exc.detail)
              except DjangoValidationError as exc:
                  errors.extend(exc.messages)
          if errors:
              raise ValidationError(errors)
 
</s> remove             if getattr(validator, 'requires_context', False):
                validator.serializer_field = self
 </s> add             if hasattr(validator, 'set_context'):
                validator.set_context(self)
 </s> remove from django.core.exceptions import ValidationError
 </s> add  </s> remove     def __call__(self, value):
        field = self.serializer_field

        # Determine the model field name that the serializer field corresponds to.
        field_name = field.source_attrs[0] if field.source_attrs else field.field_name

 </s> add     def set_context(self, serializer_field):
        # Determine the underlying model field name. This may not be the
        # same as the serializer field name if `source=<>` is set.
        self.field_name = serializer_field.source_attrs[0] </s> remove         if instance:
            queryset = queryset.exclude(pk=instance.pk)
 </s> add         if self.instance is not None:
            queryset = queryset.exclude(pk=self.instance.pk)
                # If the validation error contains a mapping of fields to
                # errors then simply raise it immediately rather than
                # attempting to accumulate a list of errors.
                if isinstance(exc.detail, dict):
                    raise
                  validator(value)
              except ValidationError as exc:
                # If the validation error contains a mapping of fields to
                # errors then simply raise it immediately rather than
                # attempting to accumulate a list of errors.
                if isinstance(exc.detail, dict):
                    raise
                  errors.extend(exc.detail)
              except DjangoValidationError as exc:
                  errors.extend(exc.messages)
          if errors:
              raise ValidationError(errors)
keep add keep keep keep keep keep
 First pass at unique_for_date, unique_for_month, unique_for_year 
rest_framework/fields.py