[Zope-CMF] quick question
Florent Guillaume
fg@nuxeo.com
12 Aug 2001 18:29:20 GMT
CMFCore.PortalContent has this code:
def manage_afterAdd(self, item, container):
"""
Add self to the workflow and catalog.
"""
#
# Are we being added (or moved)?
#
if aq_base(container) is not aq_base(self):
wf = getToolByName(self, 'portal_workflow', None)
if wf is not None:
wf.notifyCreated(self)
self.indexObject()
I don't understand the rationale behind the comparison of container and
self. In what circumstances could we have the equality:
aq_base(container) is aq_base(self) ?
>From my reading of ObjectManager, manage_afterAdd is called on
the subchildren of item, so container is never self. And in any case,
if manage_afterAdd has been called, there was a reason, so we should
do our reindexing unconditionnaly. Isn't it ?
(Same thing in beforeDelete.)
Thanks,
Florent Guillaume
Nuxeo