def build_object(self, form, appstruct: dict) -> object:
"""Builds a new object.
The default behavior is to call :py:meth:`create_object` to construct a new object, then populate it with :py:meth:`initialize_object` and finally include the created object in the transaction lifecycle with :py:meth:`add_object`.
"""
obj = self.create_object()
self.initialize_object(form, appstruct, obj)
# We do not need to explicitly call save() or commit() as we are using Zope transaction manager
self.add_object(obj)
return obj
评论列表
文章目录