      def save_object(self, obj, parent=None, fk_field=None):
          """
          Save the deserialized object and return it.
          """
          obj.save()
  
          if getattr(self, 'm2m_data', None):
              for accessor_name, object_list in self.m2m_data.items():
 
</s> remove     def save_object(self, obj):
 </s> add     def save_object(self, obj, parent=None, fk_field=None): </s> remove                 setattr(self.object, accessor_name, object_list)
 </s> add                 if isinstance(object_list, ModelSerializer):
                    fk_field = self.object._meta.get_field_by_name(accessor_name)[0].field.name
                    object_list.save_object(object_list.object, parent=self.object, fk_field=fk_field)
                else:
                    setattr(self.object, accessor_name, object_list) </s> remove         if self.parent.object:
            # Set the serializer object if it exists
            obj = getattr(self.parent.object, field_name)
            self.object = obj
 </s> add         # Set the serializer object if it exists
        obj = getattr(self.parent.object, field_name) if self.parent.object else None </s> remove         self.messages = message
 </s> add         if isinstance(message, dict):
            self.messages = [message]
        else:
            self.messages = message </s> remove     then the child's `serializer.errors` will be a list of dicts.
 </s> add     then the child's `serializer.errors` will be a list of dicts.  In the case
    of a single child, the `serializer.errors` will be a dict.
        if self._delete:
            obj.delete()
            return

        if parent and fk_field:
            setattr(self.object, fk_field, parent)

      def save_object(self, obj, parent=None, fk_field=None):
          """
          Save the deserialized object and return it.
          """
        if self._delete:
            obj.delete()
            return

        if parent and fk_field:
            setattr(self.object, fk_field, parent)

          obj.save()
  
          if getattr(self, 'm2m_data', None):
              for accessor_name, object_list in self.m2m_data.items():
keep keep keep add keep keep keep keep
 One-to-one writable, nested serializer support 
rest_framework/serializers.py