  
          self._data = None
          self._files = None
          self._errors = None
          self._deleted = None
  
          if many and instance is not None and not hasattr(instance, '__iter__'):
              raise ValueError('instance should be a queryset or other iterable with many=True')
  
          if allow_add_remove and not many:
 
</s> remove                 ret = []
 </s> add                 ret = RelationsList() </s> remove                         self._deleted = identity_to_objects.values()
 </s> add                         ret._deleted = identity_to_objects.values() </s> remove         removed_relations = []

        # Deleted related objects
        if self._deleted:
            removed_relations = list(self._deleted)

 </s> add  </s> remove             instance._removed_relations = removed_relations
 </s> add  </s> remove         # Deleted related objects
        if self._deleted:
            removed_relations = list(self._deleted)

 </s> add 
  
          self._data = None
          self._files = None
          self._errors = None

  
          if many and instance is not None and not hasattr(instance, '__iter__'):
              raise ValueError('instance should be a queryset or other iterable with many=True')
  
          if allow_add_remove and not many:
keep keep keep keep replace keep keep keep keep keep
 Fix model serializer nestesd delete behavior 
rest_framework/serializers.py