          """
          filter_kwargs = {'%s__%s' % (self.field_name, self.lookup): value}
          return qs_filter(queryset, **filter_kwargs)
  
      def exclude_current_instance(self, queryset):
          """
          If an instance is being updated, then do not include
          that instance itself as a uniqueness conflict.
          """
          if self.instance is not None:
 
</s> remove     def exclude_current_instance(self, attrs, queryset):
 </s> add     def exclude_current_instance(self, attrs, queryset, instance): </s> remove         filter_kwargs = {'%s__%s' % (self.field_name, self.lookup): value}
 </s> add         filter_kwargs = {'%s__%s' % (field_name, self.lookup): value} </s> remove         if self.instance is not None:
            return queryset.exclude(pk=self.instance.pk)
 </s> add         if instance is not None:
            return queryset.exclude(pk=instance.pk) </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         if self.instance is not None:
 </s> add         if instance is not None:
    def exclude_current_instance(self, queryset, instance):
          """
          filter_kwargs = {'%s__%s' % (self.field_name, self.lookup): value}
          return qs_filter(queryset, **filter_kwargs)
  
    def exclude_current_instance(self, queryset, instance):
          """
          If an instance is being updated, then do not include
          that instance itself as a uniqueness conflict.
          """
          if self.instance is not None:
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