I want to be able to raise an event from the property sheets to the product
if a property changes.  I'm calling it manage_afterChange.  I want it only
to fire once per transaction so that multiple changes are aggregated.
Here's the declaration I have in mind.

manage_afterChange(oldItems, newItems)
oldItems: dict of id - values before modifications
newItems: dict of new values at end of transaction

This would allow an elegant "reindex" or notification system for objects.
It would also allow for validation (ie. raise error if you don't like
newItems).  Anyway, that's it.  I'm halfway there, just can't get a method
to be called on my object _just_ before commit.

Cheers,
Tim

ps.  I'm not so sure that __getstate__ will do this for me, but that's
probably cause I have no idea what __getstate__ does.  It just doesn't sound
right  ;-)

-----Original Message-----
From: Toby Dickenson [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 12:08 PM
To: Tim McLaughlin
Cc: '[EMAIL PROTECTED]'
Subject: Re: [Zope-dev] is there a hook for before the transaction is
committed


On Mon, 5 Mar 2001 10:56:38 -0500, Tim McLaughlin
<[EMAIL PROTECTED]> wrote:

>Is there a hook for before the transaction is committed for objects which
>subclass Persistent?

__getstate__ ?

But why would you want that?



Toby Dickenson
[EMAIL PROTECTED]

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to