      Represents the instance, or a property on the instance, using hyperlinking.
      """
  
      def __init__(self, *args, **kwargs):
          # TODO: Make view_name mandatory, and have the
          # HyperlinkedModelSerializer set it on-the-fly
          self.view_name = kwargs.pop('view_name', None)
          self.format = kwargs.pop('format', None)
 
</s> remove         view_kwargs = {'pk': obj.pk}
        return reverse(view_name, kwargs=view_kwargs, request=request, format=format)
 </s> add         kwargs = {self.pk_url_kwarg: obj.pk}
        try:
            return reverse(view_name, kwargs=kwargs, request=request, format=format)
        except:
            pass

        slug = getattr(obj, self.slug_field, None)

        if not slug:
            raise ValidationError('Could not resolve URL for field using view name "%s"' % view_name)

        kwargs = {self.slug_url_kwarg: slug}
        try:
            return reverse(self.view_name, kwargs=kwargs, request=request, format=format)
        except:
            pass

        kwargs = {self.pk_url_kwarg: obj.pk, self.slug_url_kwarg: slug}
        try:
            return reverse(self.view_name, kwargs=kwargs, request=request, format=format)
        except:
            pass

        raise ValidationError('Could not resolve URL for field using view name "%s"', view_name)
    pk_url_kwarg = 'pk'
    slug_field = 'slug'
    slug_url_kwarg = None  # Defaults to same as `slug_field` unless overridden
      Represents the instance, or a property on the instance, using hyperlinking.
      """
    pk_url_kwarg = 'pk'
    slug_field = 'slug'
    slug_url_kwarg = None  # Defaults to same as `slug_field` unless overridden
  
      def __init__(self, *args, **kwargs):
          # TODO: Make view_name mandatory, and have the
          # HyperlinkedModelSerializer set it on-the-fly
          self.view_name = kwargs.pop('view_name', None)
          self.format = kwargs.pop('format', None)
keep add keep keep keep keep keep keep
 added slug support for HyperlinkedIdentityField 
rest_framework/fields.py