  
  class HyperlinkedRelatedField(RelatedField):
      lookup_field = 'pk'
  
      default_error_messages = {
          'required': _('This field is required.'),
          'no_match': _('Invalid hyperlink - No URL match.'),
          'incorrect_match': _('Invalid hyperlink - Incorrect URL match.'),
 
</s> remove         self.queryset = kwargs.pop('queryset', None)
 </s> add         self.queryset = kwargs.pop('queryset', self.queryset) </s> remove         assert view_name is not None, 'The `view_name` argument is required.'
        self.view_name = view_name
 </s> add         if view_name is not None:
            view_name = self.view_name = view_name
        assert self.view_name is not None, 'The `view_name` argument is required.'
    view_name = None
  
  class HyperlinkedRelatedField(RelatedField):
      lookup_field = 'pk'
    view_name = None
  
      default_error_messages = {
          'required': _('This field is required.'),
          'no_match': _('Invalid hyperlink - No URL match.'),
          'incorrect_match': _('Invalid hyperlink - Incorrect URL match.'),
keep keep add keep keep keep keep keep
 Docs for custom hyperlinked fields. 
rest_framework/relations.py