              [self.save_object(item, **kwargs) for item in self.object]
          else:
              self.save_object(self.object, **kwargs)
  
          if self.allow_add_remove and self._deleted:
              [self.delete_object(item) for item in self._deleted]
  
          return self.object
  
  
  class Serializer(six.with_metaclass(SerializerMetaclass, BaseSerializer)):
 
</s> remove         else:
            self.save_object(self.object, **kwargs)
 </s> add  </s> remove         if self.allow_add_remove and hasattr(obj, '_removed_relations'):
            [self.delete_object(item) for item in obj._removed_relations]

 </s> add  </s> remove         if self.allow_add_remove and hasattr(obj, '_removed_relations'):
            [self.delete_object(item) for item in obj._removed_relations]

 </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)        
              [self.save_object(item, **kwargs) for item in self.object]
          else:
              self.save_object(self.object, **kwargs)
  
            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)        
            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)        
  
          return self.object
  
  
  class Serializer(six.with_metaclass(SerializerMetaclass, BaseSerializer)):
keep keep keep keep replace replace keep keep keep keep keep
 Fix model serializer nestesd delete behavior 
rest_framework/serializers.py