                      self.queryset = manager.related.model._default_manager.all()
                  else:  # Reverse
                      self.queryset = manager.field.rel.to._default_manager.all()
              except Exception:
                  raise
                  msg = ('Serializer related fields must include a `queryset`' +
                         ' argument or set `read_only=True')
                  raise Exception(msg)
  
      ### We need this stuff to make form choices work...
 
</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         if lookup_field is not None:
            self.lookup_field = lookup_field
 </s> add         self.lookup_field = lookup_field or self.lookup_field </s> remove         view_name = self.view_name or self.parent.opts.view_name
 </s> add         view_name = self.view_name
                      self.queryset = manager.related.model._default_manager.all()
                  else:  # Reverse
                      self.queryset = manager.field.rel.to._default_manager.all()
              except Exception:

                  msg = ('Serializer related fields must include a `queryset`' +
                         ' argument or set `read_only=True')
                  raise Exception(msg)
  
      ### We need this stuff to make form choices work...
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