  
      def field_to_native(self, obj, field_name):
          request = self.context.get('request', None)
          format = self.context.get('format', None)
          view_name = self.view_name or self.parent.opts.view_name
  
          if request is None:
              warnings.warn("Using `HyperlinkedIdentityField` without including the "
                            "request in the serializer context is deprecated. "
                            "Add `context={'request': request}` when instantiating the serializer.",
 
</s> remove         if lookup_field is not None:
            self.lookup_field = lookup_field
 </s> add         self.lookup_field = lookup_field or self.lookup_field </s> remove         # TODO: Make view_name mandatory, and have the
        # HyperlinkedModelSerializer set it on-the-fly
        self.view_name = kwargs.pop('view_name', None)
        # Optionally the format of the target hyperlink may be specified
 </s> add         try:
            self.view_name = kwargs.pop('view_name')
        except KeyError:
            msg = "HyperlinkedIdentityField requires 'view_name' argument"
            raise ValueError(msg)
 </s> remove     url = HyperlinkedIdentityField()
 </s> add     # Just a placeholder to ensure 'url' is the first field
    # The field itself is actually created on initialization,
    # when the view_name and lookup_field arguments are available.
    url = Field() </s> remove         lookup_field = self.opts.lookup_field
        self.fields['url'] = HyperlinkedIdentityField(lookup_field=lookup_field)
 </s> add 
        view_name = self.view_name
  
      def field_to_native(self, obj, field_name):
          request = self.context.get('request', None)
          format = self.context.get('format', None)
        view_name = self.view_name
  
          if request is None:
              warnings.warn("Using `HyperlinkedIdentityField` without including the "
                            "request in the serializer context is deprecated. "
                            "Add `context={'request': request}` when instantiating the serializer.",
keep keep keep keep replace keep keep keep keep keep
 view_name argument to HyperlinkedModelSerializer is now properly enforced.  Closes #471 
rest_framework/relations.py