  
      is_hyperlink = True
  
  
  @python_2_unicode_compatible
  class PKOnlyObject(object):
      """
      This is a mock object, used for when we only need the pk of the object
      instance, but still want to return an object with a .pk attribute,
      in order to keep the same interface as a regular model instance.
      """
 
</s> remove         return six.text_type(self.obj)
 </s> add         return str(self.obj) </s> remove         @python_2_unicode_compatible
        class MockLazyStr(object):
 </s> add         class MockLazyStr: </s> remove class BadType(object):
 </s> add class BadType: </s> remove class BoundField(object):
 </s> add class BoundField: </s> remove         super(HyperlinkedIdentityField, self).__init__(view_name, **kwargs)
 </s> add         super().__init__(view_name, **kwargs)
class PKOnlyObject:
  
      is_hyperlink = True
  
  
class PKOnlyObject:
class PKOnlyObject:
      """
      This is a mock object, used for when we only need the pk of the object
      instance, but still want to return an object with a .pk attribute,
      in order to keep the same interface as a regular model instance.
      """
keep keep keep keep replace replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/relations.py