              "the serializer." % self.__class__.__name__
          )
  
          # By default use whatever format is given for the current context
          # unless the target is a different type to the source.
          #
          # Eg. Consider a HyperlinkedIdentityField pointing from a json
 
</s> remove         request = self.context.get('request', None)
        format = self.context.get('format', None)

        assert request is not None, (
 </s> add         assert 'request' in self.context, (
        request = self.context['request']
        format = self.context.get('format', None)

              "the serializer." % self.__class__.__name__
          )
  
        request = self.context['request']
        format = self.context.get('format', None)

          # By default use whatever format is given for the current context
          # unless the target is a different type to the source.
          #
          # Eg. Consider a HyperlinkedIdentityField pointing from a json
keep keep add keep keep keep keep
 Allow relative style hyperlinked URLs 
rest_framework/relations.py