          'incorrect_type': _('Incorrect type.  Expected url string, received %s.'),
      }
  
      def __init__(self, *args, **kwargs):
          try:
              self.view_name = kwargs.pop('view_name')
          except KeyError:
 
</s> remove         return HyperlinkedRelatedField(**kwargs)
 </s> add         return self._hyperlink_field_class(**kwargs) </s> remove         kwargs = {self.pk_url_kwarg: obj.pk, self.slug_url_kwarg: slug}
 </s> add         Takes the matched URL conf arguments, and the queryset, and should
        return an object instance, or raise an `ObjectDoesNotExist` exception.
        """
        lookup = view_kwargs.get(self.lookup_field, None)
        pk = view_kwargs.get(self.pk_url_kwarg, None)
        slug = view_kwargs.get(self.slug_url_kwarg, None)

        if lookup is not None:
            filter_kwargs = {self.lookup_field: lookup}
        elif pk is not None:
            filter_kwargs = {'pk': pk}
        elif slug is not None:
            filter_kwargs = {self.slug_field: slug}
        else:
            raise ObjectDoesNotExist()

        return queryset.get(**filter_kwargs)

    def to_native(self, obj):
        view_name = self.view_name
        request = self.context.get('request', None)
        format = self.format or self.context.get('format', None)

        if request is None:
            msg = (
                "Using `HyperlinkedRelatedField` without including the request "
                "in the serializer context is deprecated. "
                "Add `context={'request': request}` when instantiating "
                "the serializer."
            )
            warnings.warn(msg, DeprecationWarning, stacklevel=4)

        # If the object has not yet been saved then we cannot hyperlink to it.
        if getattr(obj, 'pk', None) is None:
            return

        # Return the hyperlink, or error if incorrectly configured. </s> remove             obj = queryset.get()
        except ObjectDoesNotExist:
 </s> add             return self.get_object(queryset, match.view_name,
                                   match.args, match.kwargs)
        except (ObjectDoesNotExist, TypeError, ValueError):
    # These are all pending deprecation
    pk_url_kwarg = 'pk'
    slug_field = 'slug'
    slug_url_kwarg = None  # Defaults to same as `slug_field` unless overridden

          'incorrect_type': _('Incorrect type.  Expected url string, received %s.'),
      }
  
    # These are all pending deprecation
    pk_url_kwarg = 'pk'
    slug_field = 'slug'
    slug_url_kwarg = None  # Defaults to same as `slug_field` unless overridden

      def __init__(self, *args, **kwargs):
          try:
              self.view_name = kwargs.pop('view_name')
          except KeyError:
keep keep add keep keep keep keep
 lookup_field on hyperlinked fields, and overriddable hyperlinked fields.  Closes #688 
rest_framework/relations.py