      slug_field = 'slug'
      slug_url_kwarg = None  # Defaults to same as `slug_field` unless overridden
  
      def __init__(self, *args, **kwargs):
          # 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
          self.format = kwargs.pop('format', None)
          lookup_field = kwargs.pop('lookup_field', None)
          if lookup_field is not None:
              self.lookup_field = lookup_field
  
 
</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     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         view_name = self.view_name or self.parent.opts.view_name
 </s> add         view_name = self.view_name </s> remove         lookup_field = self.opts.lookup_field
        self.fields['url'] = HyperlinkedIdentityField(lookup_field=lookup_field)
 </s> add 
        try:
            self.view_name = kwargs.pop('view_name')
        except KeyError:
            msg = "HyperlinkedIdentityField requires 'view_name' argument"
            raise ValueError(msg)

      slug_field = 'slug'
      slug_url_kwarg = None  # Defaults to same as `slug_field` unless overridden
  
      def __init__(self, *args, **kwargs):
        try:
            self.view_name = kwargs.pop('view_name')
        except KeyError:
            msg = "HyperlinkedIdentityField requires 'view_name' argument"
            raise ValueError(msg)

        try:
            self.view_name = kwargs.pop('view_name')
        except KeyError:
            msg = "HyperlinkedIdentityField requires 'view_name' argument"
            raise ValueError(msg)

        try:
            self.view_name = kwargs.pop('view_name')
        except KeyError:
            msg = "HyperlinkedIdentityField requires 'view_name' argument"
            raise ValueError(msg)

        try:
            self.view_name = kwargs.pop('view_name')
        except KeyError:
            msg = "HyperlinkedIdentityField requires 'view_name' argument"
            raise ValueError(msg)

          self.format = kwargs.pop('format', None)
          lookup_field = kwargs.pop('lookup_field', None)
          if lookup_field is not None:
              self.lookup_field = lookup_field
  
keep keep keep keep replace replace replace replace keep keep keep keep keep
 view_name argument to HyperlinkedModelSerializer is now properly enforced.  Closes #471 
rest_framework/relations.py