本文整理汇总了Python中OFS.ObjectManager.ObjectManager._delObject方法的典型用法代码示例。如果您正苦于以下问题:Python ObjectManager._delObject方法的具体用法?Python ObjectManager._delObject怎么用?Python ObjectManager._delObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OFS.ObjectManager.ObjectManager
的用法示例。
在下文中一共展示了ObjectManager._delObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _delObject
# 需要导入模块: from OFS.ObjectManager import ObjectManager [as 别名]
# 或者: from OFS.ObjectManager.ObjectManager import _delObject [as 别名]
def _delObject(self, id, dp=1, suppress_events=False):
"""When deleted clear __primary_parent__."""
obj = self._getOb(id, None)
if obj is None:
# Added this check because we are seeing stack traces in the UI.
# We aren't 100% sure what is causing the object to disappear from
# the ObjectManager. It could be that a different user had already
# deleted it or that a single user had two brower tabs open. Ian saw
# a case were the references on an object were wrong (getPrimaryId
# pointed to the wrong location) but I'm not sure that is what is
# causing this problem. -EAD
log.warning(
"Tried to delete object id '%s' but didn't find it on %s",
id, self.getPrimaryId())
return
ObjectManager._delObject(self, id, dp, suppress_events)
obj.__primary_parent__ = None