          Set any attributes on the object that are implicit in the request.
          """
          # pk and/or slug attributes are implicit in the URL.
          lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
          lookup = self.kwargs.get(lookup_url_kwarg, None)
          pk = self.kwargs.get(self.pk_url_kwarg, None)
          slug = self.kwargs.get(self.slug_url_kwarg, None)
          slug_field = slug and self.slug_field or None
  
          if lookup:
              setattr(obj, self.lookup_field, lookup)
  
          if pk:
              setattr(obj, 'pk', pk)
  
          if slug:
              setattr(obj, slug_field, slug)
  
          # Ensure we clean the attributes so that we don't eg return integer
 
</s> remove         if slug:
            setattr(obj, slug_field, slug)
 </s> add         setattr(obj, self.lookup_field, lookup_value) </s> remove         # pk and/or slug attributes are implicit in the URL.
 </s> add  </s> remove             exclude = _get_validation_exclusions(obj, pk, slug_field, self.lookup_field)
 </s> add             exclude = _get_validation_exclusions(obj, self.lookup_field) </s> remove         pk = self.kwargs.get(self.pk_url_kwarg, None)
        slug = self.kwargs.get(self.slug_url_kwarg, None)
 </s> add  </s> remove         try:
            return reverse(view_name, kwargs=kwargs, request=request, format=format)
        except NoReverseMatch:
            pass

        if self.pk_url_kwarg != 'pk':
            # Only try pk if it has been explicitly set.
            # Otherwise, the default `lookup_field = 'pk'` has us covered.
            pk = obj.pk
            kwargs = {self.pk_url_kwarg: pk}
            try:
                return reverse(view_name, kwargs=kwargs, request=request, format=format)
            except NoReverseMatch:
                pass

        slug = getattr(obj, self.slug_field, None)
        if slug is not None:
            # Only try slug if it corresponds to an attribute on the object.
            kwargs = {self.slug_url_kwarg: slug}
            try:
                ret = reverse(view_name, kwargs=kwargs, request=request, format=format)
                if self.slug_field == 'slug' and self.slug_url_kwarg == 'slug':
                    # If the lookup succeeds using the default slug params,
                    # then `slug_field` is being used implicitly, and we
                    # we need to warn about the pending deprecation.
                    msg = 'Implicit slug field hyperlinked fields are deprecated.' \
                          'You should set `lookup_field=slug` on the HyperlinkedRelatedField.'
                    warnings.warn(msg, DeprecationWarning, stacklevel=2)
                return ret
            except NoReverseMatch:
                pass

        raise NoReverseMatch()
 </s> add         return reverse(view_name, kwargs=kwargs, request=request, format=format)
        lookup_value = self.kwargs[lookup_url_kwarg]
          Set any attributes on the object that are implicit in the request.
          """
          # pk and/or slug attributes are implicit in the URL.
          lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
        lookup_value = self.kwargs[lookup_url_kwarg]
  
          if slug:
              setattr(obj, slug_field, slug)
  
          # Ensure we clean the attributes so that we don't eg return integer
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Remove `pk_url_field`, `slug_url_field`, `slug_field`.

Closes #1773. 
rest_framework/mixins.py