[Zope3-Users] Re: Autocreated content objects
td at yoma.com.au
Mon Sep 25 20:18:13 EDT 2006
> The IntId subscribers are fired on
> zope.app.container.interfaces.IObjectAddedEvent and IObjectRemovedEvent.
That's correct, however the (IWrite)Container __setitem__ method invokes
the ObjectAddedEvent for you when you add an object to the container.
Your code below looks like it's running zope directly, e.g. `zopectl
debug`. In this case you need to explicitly set a/the current site
yourself. Try insert the following first up...
from zope.app.component import hooks
> On Mon, 25 Sep 2006 18:55:11 +0200, Volker Bachschneider wrote
>> Philipp von Weitershausen schrieb:
>>> John Maddison wrote:
>>>> Is it possible/wise to "auto-create" content objects in the ZODB? Say
>>> Yeah, like Stephan says, Zope should probably send an
>>> IObjectCreatedEvent there. In the mean time, you can hook into
>> That works fine to me, but:
>> import transaction
>> from zope.app.myproject.person import Person
>> from zope.event import notify
>> from zope.livecycleevent import ObjectCreatedEvent
>> obj = app.root()['005'] = Person()
>> obj.nnam = u'Karlson'
>> creates a perfect object with timestamp in the ZODB. But the IntId /
>> Catalog do not recognizes the object. On the other hand, an object
>> manual created via zmi and programatically modified via Script (with
>> event ObjectModifiedEvent) is noticed and can be reindexed. Objects
>> created only via zmi are recognizes and indexed. I think i have to
>> fire up an IntIdAddedEvent but do not how.
>> Zope3-users mailing list
>> Zope3-users at zope.org
> Zope3-users mailing list
> Zope3-users at zope.org
More information about the Zope3-users