[Zope3-Users] Re: Autocreated content objects
mats.nordgren
mats at ronin-group.org
Mon Sep 25 17:15:04 EDT 2006
The IntId subscribers are fired on
zope.app.container.interfaces.IObjectAddedEvent and IObjectRemovedEvent.
Cheers,
Mats
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'
> notify(ObjectCreatedEvent(obj))
> transaction.commit()
>
> 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.
>
> Volker
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
More information about the Zope3-users
mailing list