              slug_field = self.get_slug_field()
              setattr(obj, slug_field, slug)
  
  
  class DestroyModelMixin(object):
      """
      Destroy a model instance.
      Should be mixed in with `SingleObjectBaseView`.
      """
 
</s> remove         response = self.view(request, pk=1).render()
 </s> add         response = self.view(request, pk='1').render() </s> remove         # Reverse relations
        for (obj, model) in self.opts.model._meta.get_all_related_m2m_objects_with_model():
            field_name = obj.field.related_query_name()
            if field_name in attrs:
                self.m2m_data[field_name] = attrs.pop(field_name)
 </s> add         else:
            # Reverse relations
            for (obj, model) in self.opts.model._meta.get_all_related_m2m_objects_with_model():
                field_name = obj.field.related_query_name()
                if field_name in attrs:
                    self.m2m_data[field_name] = attrs.pop(field_name)

            # Forward relations
            for field in self.opts.model._meta.many_to_many:
                if field.name in attrs:
                    self.m2m_data[field.name] = attrs.pop(field.name) </s> remove         # Forward relations
        for field in self.opts.model._meta.many_to_many:
            if field.name in attrs:
                self.m2m_data[field.name] = attrs.pop(field.name)
 </s> add             instance = self.opts.model(**attrs) </s> remove         instance = self.opts.model(**attrs)
 </s> add  </s> remove             return instance
 </s> add 
        # Ensure we clean the attributes so that we don't eg return integer
        # pk using a string representation, as provided by the url conf kwarg.
        obj.full_clean()

              slug_field = self.get_slug_field()
              setattr(obj, slug_field, slug)
  
        # Ensure we clean the attributes so that we don't eg return integer
        # pk using a string representation, as provided by the url conf kwarg.
        obj.full_clean()

  
  class DestroyModelMixin(object):
      """
      Destroy a model instance.
      Should be mixed in with `SingleObjectBaseView`.
      """
keep keep add keep keep keep keep keep keep
 Fix for pks returning as strings when set in pre_save.  Fixes #482. Thanks to @n8agrin for the bug report. 
rest_framework/mixins.py