[Zope3-dev] events: getting the context of objects

Jean-Marc Orliaguet jmo at ita.chalmers.se
Fri May 20 06:15:52 EDT 2005


Hi!

I want to get the location about created object through event
notifications, but there is never enough context (there  is "Not enough
context to determine location root", ...)

  <subscriber
    handler=".objectevents.objectCreated"
    for="zope.app.event.interfaces.IObjectCreatedEvent"
    trusted="True"
  />


def objectCreated(event):
    """event handler
    """
    object = event.object

    locatable = IPhysicallyLocatable(object, None)
    if locatable is not None:
        path = locatable.getPath()
     ....

What is missing?

/JM



More information about the Zope3-dev mailing list