Thierry FLORAC wrote:
I've build a simple adapter that modifies context properties through
annotations ; everything works fine.
In several cases, when some attributes are updated, I do a
"notify(ObjectModifiedEvent(self.context))" so that several subscribers
are called.

My problem is then that if several attributes modifications are done,
several "ObjectModifiedEvent" are sent and the same handler is called
several times (with the same parameters) ; so is it easily possible to
prevent the same event to be called several times for a same context and
a same request ?
Or should I try to use request annotations and subscribe to
IEndRequestEvent (if it's not too late and not too expensive...) ?

Yes that's the proper way to do compress events: record the stuff to do, and do it at the end of the request.

Depending on the stuff to do, it may involve subtleties, for instance if you modify one object then delete it in the same request, you don't want to call your final handler for that object...


Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   [EMAIL PROTECTED]
Zope3-users mailing list

Reply via email to