              instance = self.opts.model(**attrs)
  
          instance._related_data = related_data
          instance._m2m_data = m2m_data
  
          return instance
 
</s> remove         # Reverse fk relations
        for (obj, model) in self.opts.model._meta.get_all_related_objects_with_model():
 </s> add         # Reverse fk or one-to-one relations
        for (obj, model) in meta.get_all_related_objects_with_model(): </s> remove         for field in self.opts.model._meta.many_to_many:
 </s> add         for field in meta.many_to_many:
        # Any relations that cannot be set until we've
        # saved the model get hidden away on these
        # private attributes, so we can deal with them
        # at the point of save.
              instance = self.opts.model(**attrs)
  
        # Any relations that cannot be set until we've
        # saved the model get hidden away on these
        # private attributes, so we can deal with them
        # at the point of save.
          instance._related_data = related_data
          instance._m2m_data = m2m_data
  
          return instance
keep add keep keep keep keep
 Clean up and comment `restore_object` 
rest_framework/serializers.py