      def pre_save(self, obj):
          """
          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
 
</s> remove         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)
 </s> add         lookup_value = self.kwargs[lookup_url_kwarg] </s> remove         pk = self.kwargs.get(self.pk_url_kwarg, None)
        slug = self.kwargs.get(self.slug_url_kwarg, None)
 </s> add  </s> remove         # Determine the base queryset to use.
        if queryset is None:
            queryset = self.filter_queryset(self.get_queryset())
        else:
            pass  # Deprecation warning
 </s> add         queryset = self.filter_queryset(self.get_queryset()) </s> remove         if lookup is not None:
            filter_kwargs = {self.lookup_field: lookup}
        elif pk is not None and self.lookup_field == 'pk':
            warnings.warn(
                'The `pk_url_kwarg` attribute is deprecated. '
                'Use the `lookup_field` attribute instead',
                DeprecationWarning
            )
            filter_kwargs = {'pk': pk}
        elif slug is not None and self.lookup_field == 'pk':
            warnings.warn(
                'The `slug_url_kwarg` attribute is deprecated. '
                'Use the `lookup_field` attribute instead',
                DeprecationWarning
            )
            filter_kwargs = {self.slug_field: slug}
        else:
 </s> add         if lookup is None: </s> remove         lookup = view_kwargs.get(self.lookup_field, None)
        pk = view_kwargs.get(self.pk_url_kwarg, None)
        slug = view_kwargs.get(self.slug_url_kwarg, None)

        if lookup is not None:
            filter_kwargs = {self.lookup_field: lookup}
        elif pk is not None:
            filter_kwargs = {'pk': pk}
        elif slug is not None:
            filter_kwargs = {self.slug_field: slug}
        else:
            raise ObjectDoesNotExist()

 </s> add         lookup_value = view_kwargs[self.lookup_field]
        filter_kwargs = {self.lookup_field: lookup_value}
      def pre_save(self, obj):
          """
          Set any attributes on the object that are implicit in the request.
          """

          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
keep keep keep keep replace keep keep keep keep keep
 Remove `pk_url_field`, `slug_url_field`, `slug_field`.

Closes #1773. 
rest_framework/mixins.py