              op = 'gt' if is_next else 'lt'
              order = '_order' if is_next else '-_order'
              order_field = self._meta.order_with_respect_to
              filter_args = order_field.get_filter_kwargs_for_object(self)
              obj = self._default_manager.filter(**filter_args).filter(**{
                  '_order__%s' % op: self._default_manager.values('_order').filter(**{
                      self._meta.pk.name: self.pk
                  })
              }).order_by(order)[:1].get()
              setattr(self, cachename, obj)
          return getattr(self, cachename)
 
</s> remove         model = self.rel.related_model if self.reverse else self.rel.model
 </s> add         related_model = self.rel.related_model if self.reverse else self.rel.model
 </s> remove             model._default_manager.__class__,
 </s> add             related_model._default_manager.__class__, </s> remove         ensure_default_manager(cls)
 </s> add         if not opts.managers or cls._requires_legacy_default_manager():
            if any(f.name == 'objects' for f in opts.fields):
                raise ValueError(
                    "Model %s must specify a custom Manager, because it has a "
                    "field named 'objects'." % cls.__name__
                )
            manager = Manager()
            manager.auto_created = True
            cls.add_to_class('objects', manager) </s> remove         manager = self.related.related_model._default_manager
        # If the related manager indicates that it should be used for
        # related fields, respect that.
        if not getattr(manager, 'use_for_related_fields', False):
            manager = self.related.related_model._base_manager
 </s> add         related_model = self.related.related_model

        if (not related_model._meta.base_manager_name and
                getattr(related_model._default_manager, 'use_for_related_fields', False)):
            if not getattr(related_model._default_manager, 'silence_use_for_related_fields_deprecation', False):
                warnings.warn(
                    "use_for_related_fields is deprecated, instead "
                    "set Meta.base_manager_name on '{}'.".format(related_model._meta.label),
                    RemovedInDjango20Warning, 2
                )
            manager = related_model._default_manager
        else:
            manager = related_model._base_manager
 </s> remove         manager = self.field.remote_field.model._default_manager
        # If the related manager indicates that it should be used for
        # related fields, respect that.
        if not getattr(manager, 'use_for_related_fields', False):
            manager = self.field.remote_field.model._base_manager
 </s> add         related_model = self.field.remote_field.model

        if (not related_model._meta.base_manager_name and
                getattr(related_model._default_manager, 'use_for_related_fields', False)):
            if not getattr(related_model._default_manager, 'silence_use_for_related_fields_deprecation', False):
                warnings.warn(
                    "use_for_related_fields is deprecated, instead "
                    "set Meta.base_manager_name on '{}'.".format(related_model._meta.label),
                    RemovedInDjango20Warning, 2
                )
            manager = related_model._default_manager
        else:
            manager = related_model._base_manager

            obj = self.__class__._default_manager.filter(**filter_args).filter(**{
                '_order__%s' % op: self.__class__._default_manager.values('_order').filter(**{
              op = 'gt' if is_next else 'lt'
              order = '_order' if is_next else '-_order'
              order_field = self._meta.order_with_respect_to
              filter_args = order_field.get_filter_kwargs_for_object(self)
            obj = self.__class__._default_manager.filter(**filter_args).filter(**{
                '_order__%s' % op: self.__class__._default_manager.values('_order').filter(**{
            obj = self.__class__._default_manager.filter(**filter_args).filter(**{
                '_order__%s' % op: self.__class__._default_manager.values('_order').filter(**{
                      self._meta.pk.name: self.pk
                  })
              }).order_by(order)[:1].get()
              setattr(self, cachename, obj)
          return getattr(self, cachename)
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #10506, #13793, #14891, #25201 -- Introduced new APIs to specify models' default and base managers.

This deprecates use_for_related_fields.

Old API:

class CustomManager(models.Model):
    use_for_related_fields = True

class Model(models.Model):
    custom_manager = CustomManager()

New API:

class Model(models.Model):
    custom_manager = CustomManager()

    class Meta:
        base_manager_name = 'custom_manager'

Refs #20932, #25897.

Thanks Carl Meyer for the guidance throughout this work.
Thanks Tim Graham for writing the docs. 
django/db/models/base.py