Tres Seaver wrote:
I'd like to get the CMF-trunk "clean" of Deprecation warnings, at least
when running unit tests or starting up Zope, and those emitted by
OFS.subscribers are the remaining ones I know about.

How do you mean for objects to handle the case where *they* need to
respond to container events.  E.g., the CookieCrumbler needs to register
/ unregister itself as a traversal hook on its container;  there is no
"external" subscriber which should be responsible for that (unlike, say,
the catalog or the workflow tool).

Not if you think in term of placeful subscriber, but here the standard way is to have just a subscriber that is a function, and to do:


from import IObjectMovedEvent
from OFS.interfaces import IObjectWillBeMovedEvent

def handleObjectEvent(ob, event):
    """Notification from the event service.
    if IObjectMovedEvent.providedBy(event):
        if event.newParent is not None:
            # here register hook
    elif IObjectWillBeMovedEvent.providedBy(event):
        if event.oldParent is not None:
            # here unregister hook

WRT content, do you have code in hand which makes the catalog and
workflow tools subscribers, so that we could rip out the
'manage_afterAdd' and 'manage_beforeDelete' from the content base class?

No I haven't done that yet even in CPS (for lack of time, not because of difficulty).


Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   [EMAIL PROTECTED]
Zope-CMF maillist  -

See for bug reports and feature requests

Reply via email to