          Save the deserialized object and return it.
          """
          if isinstance(self.object, list):
              [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
 
</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)         </s> remove         removed_relations = []

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

 </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 
          Save the deserialized object and return it.
          """
          if isinstance(self.object, list):
              [self.save_object(item, **kwargs) for item in self.object]


  
          if self.allow_add_remove and self._deleted:
              [self.delete_object(item) for item in self._deleted]
  
          return self.object
keep keep keep keep replace replace keep keep keep keep keep
 Fix model serializer nestesd delete behavior 
rest_framework/serializers.py