  import functools
  import inspect
  import re
  import uuid
  from collections import OrderedDict
  from collections.abc import Mapping
  
  from django.conf import settings
  from django.core.exceptions import ObjectDoesNotExist
 
</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 exclude_current_instance(self, queryset):
 </s> add     def exclude_current_instance(self, 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     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):
import warnings
  import functools
  import inspect
  import re
  import uuid
import warnings
  from collections import OrderedDict
  from collections.abc import Mapping
  
  from django.conf import settings
  from django.core.exceptions import ObjectDoesNotExist
keep keep keep add 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/fields.py