def updateReferencingListAttrs(self):
"""Update all referencing list attributes.
Checks through all object references, and asks each referenced
object to remove us from any list attributes that they might have.
"""
for attr in self.klass().allAttrs():
if isinstance(attr, ObjRefAttr):
value = getattr(self, '_' + attr.name())
if value is not None:
if isinstance(value, (MiddleObject, InstanceType)):
value.removeObjectFromListAttrs(self)
elif isinstance(value, long):
obj = self.store().objRefInMem(value)
if obj:
obj.removeObjectFromListAttrs(self)
评论列表
文章目录