  
  
  class NestedValidationError(ValidationError):
      """
      The default ValidationError behavior is to stringify each item in the list
      if the messages are a list of error messages.
  
 
</s> remove                         self._deleted = identity_to_objects.values()
 </s> add                         ret._deleted = identity_to_objects.values() </s> remove                 ret = []
 </s> add                 ret = RelationsList() </s> remove         removed_relations = []

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

 </s> add  </s> remove         else:
            self.save_object(self.object, **kwargs)
 </s> add  </s> remove         if self.allow_add_remove and self._deleted:
            [self.delete_object(item) for item in self._deleted]
 </s> add             if self.allow_add_remove and self.object._deleted:
                [self.delete_object(item) for item in self.object._deleted]
        else:
            self.save_object(self.object, **kwargs)        
class RelationsList(list):
    _deleted = []

  
  
class RelationsList(list):
    _deleted = []

  class NestedValidationError(ValidationError):
      """
      The default ValidationError behavior is to stringify each item in the list
      if the messages are a list of error messages.
  
keep add keep keep keep keep keep
 Fix model serializer nestesd delete behavior 
rest_framework/serializers.py