[z3-five] Events / Archetypes

Anton Stonor anton at headnet.dk
Fri Aug 4 13:49:03 CEST 2006


Kai Diefenbach wrote:

> Trying out Zope 3 events I experienced unexpected behaviour. Maybe
> someone can help out. I'm using Zope-2.9.4 and Plone 2.5.

I'm no zope 3 event expert, but this behavior might be caused by the 
fact that decent event support has not been landed for Plone/Archetypes 
yet (as far as I know).

What has been implemented in Zope 2.9 is basic z3 events for Zope 
containers. And since Archetypes object creation is kind-of-broken it 
might lead to unexpected behavior.  When I tried the IObjectAddedEvent 
event with a ATDocument, the event handler was called 4 times (!) in a 
row when adding a single object.

It is probably more safe to use the
at_post_create_script or at_post_edit_script hooks.

This branch adds event support to the at_post_edit_script:
http://dev.plone.org/archetypes/browser/Archetypes/branches/plip_145_TTWLocking


/Anton



More information about the z3-five mailing list