Hi Jean-Marc Created object don't have a ILocation. They have to be added first to a container.
Use ObjectAddedEvent for get a object with a ILocation. Regards Roger Ineichen > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Jean-Marc Orliaguet > Sent: Friday, May 20, 2005 12:16 PM > To: [email protected] > Subject: [Zope3-dev] events: getting the context of objects > > > 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 > > _______________________________________________ > Zope3-dev mailing list > [email protected] > Unsub: > http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch > > _______________________________________________ Zope3-dev mailing list [email protected] Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
