          self.view_name = kwargs.pop('view_name', None)
          # Optionally the format of the target hyperlink may be specified
          self.format = kwargs.pop('format', None)
  
          self.slug_field = kwargs.pop('slug_field', self.slug_field)
          default_slug_kwarg = self.slug_url_kwarg or self.slug_field
          self.pk_url_kwarg = kwargs.pop('pk_url_kwarg', self.pk_url_kwarg)
          self.slug_url_kwarg = kwargs.pop('slug_url_kwarg', default_slug_kwarg)
  
 
</s> remove         kwargs = {self.pk_url_kwarg: obj.pk}
 </s> add         lookup_field = getattr(obj, self.lookup_field)
        kwargs = {self.lookup_field: lookup_field} </s> remove     read_only = True
 </s> add 
        self.lookup_field = kwargs.pop('lookup_field', self.lookup_field)

        # These are pending deprecation
        if 'pk_url_kwarg' in kwargs:
            msg = 'pk_url_kwarg is pending deprecation. Use lookup_field instead.'
            warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
        if 'slug_url_kwarg' in kwargs:
            msg = 'slug_url_kwarg is pending deprecation. Use lookup_field instead.'
            warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
        if 'slug_field' in kwargs:
            msg = 'slug_field is pending deprecation. Use lookup_field instead.'
            warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)

          self.view_name = kwargs.pop('view_name', None)
          # Optionally the format of the target hyperlink may be specified
          self.format = kwargs.pop('format', None)
  
        self.lookup_field = kwargs.pop('lookup_field', self.lookup_field)

        # These are pending deprecation
        if 'pk_url_kwarg' in kwargs:
            msg = 'pk_url_kwarg is pending deprecation. Use lookup_field instead.'
            warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
        if 'slug_url_kwarg' in kwargs:
            msg = 'slug_url_kwarg is pending deprecation. Use lookup_field instead.'
            warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
        if 'slug_field' in kwargs:
            msg = 'slug_field is pending deprecation. Use lookup_field instead.'
            warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)

          self.slug_field = kwargs.pop('slug_field', self.slug_field)
          default_slug_kwarg = self.slug_url_kwarg or self.slug_field
          self.pk_url_kwarg = kwargs.pop('pk_url_kwarg', self.pk_url_kwarg)
          self.slug_url_kwarg = kwargs.pop('slug_url_kwarg', default_slug_kwarg)
  
keep keep keep add keep keep keep keep keep
 HyperlinkedIdentityField uses `lookup_field` kwarg.

According to the [Serializers API Guide][1], `HyperlinkedIdentityField`
takes `lookup_field` as a kwarg like the other related fields and the
generic views. However, this was not actually implemented.

[1]: http://django-rest-framework.org/api-guide/serializers.html#hyperlinkedmodelserializer 
rest_framework/relations.py