  
          return instance
  
      def _save(self, parent=None, fk_field=None):
          if parent and fk_field:
              setattr(self.object, fk_field, parent)
          self.object.save()
  
          if getattr(self, 'm2m_data', None):
 
</s> remove     target = models.OneToOneField(OneToOneTarget, related_name='target_source')
 </s> add     target = models.OneToOneField(OneToOneTarget, null=True, blank=True,
                                  related_name='target_source')
        if self.delete:
            self.object.delete()
            return

  
          return instance
  
      def _save(self, parent=None, fk_field=None):
        if self.delete:
            self.object.delete()
            return

          if parent and fk_field:
              setattr(self.object, fk_field, parent)
          self.object.save()
  
          if getattr(self, 'm2m_data', None):
keep keep keep add keep keep keep keep keep
 Add one-to-one nested update and delete functionality 
rest_framework/serializers.py