      def __call__(self):
          if self.is_update:
              raise SkipField()
          if callable(self.default):
              return self.default()
          return self.default
  
      def __repr__(self):
          return '%s(%s)' % (self.__class__.__name__, repr(self.default))
  
 
</s> remove     def set_context(self, serializer_field):
        self.is_update = serializer_field.parent.instance is not None
        if callable(self.default) and hasattr(self.default, 'set_context') and not self.is_update:
            self.default.set_context(serializer_field)

    def __call__(self):
        if self.is_update:
 </s> add     def __call__(self, serializer_field):
        is_update = serializer_field.parent.instance is not None
        if is_update: </s> remove     def set_context(self, serializer_field):
        self.user = serializer_field.context['request'].user
 </s> add     requires_context = True </s> remove             return self.default()
 </s> add             if getattr(self.default, 'requires_context', False):
                return self.default(self)
            else:
                return self.default()
 </s> remove     def __call__(self):
        return self.user
 </s> add     def __call__(self, serializer_field):
        return serializer_field.context['request'].user </s> remove         queryset = self.filter_queryset(value, queryset)
        queryset = self.exclude_current_instance(queryset)
 </s> add         queryset = self.filter_queryset(value, queryset, field_name)
        queryset = self.exclude_current_instance(queryset, instance)
            if hasattr(self.default, 'set_context'):
                warnings.warn(
                    "Method `set_context` on defaults is deprecated and will "
                    "no longer be called starting with 3.12. Instead set "
                    "`requires_context = True` on the class, and accept the "
                    "context as an additional argument.",
                    DeprecationWarning, stacklevel=2
                )
                self.default.set_context(self)

            if getattr(self.default, 'requires_context', False):
                return self.default(serializer_field)
            else:
                return self.default()
      def __call__(self):
          if self.is_update:
              raise SkipField()
          if callable(self.default):
            if hasattr(self.default, 'set_context'):
                warnings.warn(
                    "Method `set_context` on defaults is deprecated and will "
                    "no longer be called starting with 3.12. Instead set "
                    "`requires_context = True` on the class, and accept the "
                    "context as an additional argument.",
                    DeprecationWarning, stacklevel=2
                )
                self.default.set_context(self)

            if getattr(self.default, 'requires_context', False):
                return self.default(serializer_field)
            else:
                return self.default()
          return self.default
  
      def __repr__(self):
          return '%s(%s)' % (self.__class__.__name__, repr(self.default))
  
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/fields.py