          Filter the queryset to all instances matching the given attributes.
          """
          # If this is an update, then any unprovided field should
          # have it's value set based on the existing instance attribute.
          if self.instance is not None:
              for field_name in self.fields:
                  if field_name not in attrs:
                      attrs[field_name] = getattr(self.instance, field_name)
  
          # Determine the filter keyword arguments and filter the queryset.
 
</s> remove                     attrs[field_name] = getattr(self.instance, field_name)
 </s> add                     attrs[field_name] = getattr(instance, field_name) </s> remove     def filter_queryset(self, attrs, queryset):
 </s> add     def filter_queryset(self, attrs, queryset, instance): </s> remove     def set_context(self, serializer_field):
        """
        This hook is called by the serializer instance,
        prior to the validation call being made.
        """
        # 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[-1]
        # Determine the existing instance, if this is an update operation.
        self.instance = getattr(serializer_field.parent, 'instance', None)

    def filter_queryset(self, value, queryset):
 </s> add     def filter_queryset(self, value, queryset, field_name): </s> remove     def __call__(self, value):
 </s> add     def __call__(self, value, serializer_field):
        # Determine the underlying model field name. This may not be the
        # same as the serializer field name if `source=<>` is set.
        field_name = serializer_field.source_attrs[-1]
        # Determine the existing instance, if this is an update operation.
        instance = getattr(serializer_field.parent, 'instance', None)
 </s> remove     def __call__(self, attrs):
 </s> add     def __call__(self, attrs, serializer):
        # Determine the underlying model field names. These may not be the
        # same as the serializer field names if `source=<>` is set.
        field_name = serializer.fields[self.field].source_attrs[-1]
        date_field_name = serializer.fields[self.date_field].source_attrs[-1]
        # Determine the existing instance, if this is an update operation.
        instance = getattr(serializer, 'instance', None)

        if instance is not None:
          Filter the queryset to all instances matching the given attributes.
          """
          # If this is an update, then any unprovided field should
          # have it's value set based on the existing instance attribute.
        if instance is not None:
              for field_name in self.fields:
                  if field_name not in attrs:
                      attrs[field_name] = getattr(self.instance, field_name)
  
          # Determine the filter keyword arguments and filter the queryset.
keep keep keep keep replace keep keep keep keep keep
 Drop `set_context()` (#7062)

* Do not persist the context in validators

Fixes encode/django-rest-framework#5760

* Drop set_context() in favour of 'requires_context = True' 
rest_framework/validators.py