本文整理汇总了Python中Products.Archetypes.BaseObject.BaseObject._notifyOfCopyTo方法的典型用法代码示例。如果您正苦于以下问题:Python BaseObject._notifyOfCopyTo方法的具体用法?Python BaseObject._notifyOfCopyTo怎么用?Python BaseObject._notifyOfCopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.Archetypes.BaseObject.BaseObject
的用法示例。
在下文中一共展示了BaseObject._notifyOfCopyTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _notifyOfCopyTo
# 需要导入模块: from Products.Archetypes.BaseObject import BaseObject [as 别名]
# 或者: from Products.Archetypes.BaseObject.BaseObject import _notifyOfCopyTo [as 别名]
def _notifyOfCopyTo(self, container, op=0):
"""In the case of a move (op=1) we need to make sure
references are mainained for all referencable objects within
the one being moved.
manage_renameObject calls _notifyOfCopyTo so that the
object being renamed doesn't lose its references. But
manage_renameObject calls _delObject which calls
manage_beforeDelete on all the children of the object
being renamed which deletes all references for children
of the object being renamed. Here is a patch that does
recursive calls for _notifyOfCopyTo to address that
problem.
"""
# XXX this doesn't appear to be necessary anymore, if it is
# it needs to be used in BaseBTreeFolder as well, it currently
# is not.
BaseObject._notifyOfCopyTo(self, container, op=op)
# keep reference info internally when op == 1 (move)
# because in those cases we need to keep refs
if op==1:
self._v_cp_refs = 1
for child in self.contentValues():
if IReferenceable.providedBy(child):
child._notifyOfCopyTo(self, op)
示例2: _notifyOfCopyTo
# 需要导入模块: from Products.Archetypes.BaseObject import BaseObject [as 别名]
# 或者: from Products.Archetypes.BaseObject.BaseObject import _notifyOfCopyTo [as 别名]
def _notifyOfCopyTo(self, container, op=0):
# OFS.CopySupport notify
BaseObject._notifyOfCopyTo(self, container, op=op)
# keep reference info internally when op == 1 (move)
# because in those cases we need to keep refs
if op == 1:
self._v_cp_refs = 1