[Zope-CMF] Event Notification

Chris Withers chrisw@nipltd.com
Tue, 10 Jul 2001 17:04:01 +0100


seb bacon wrote:
> 
> Hmm, tricky to catch all circumstances.  Something like a combination
> of the manage_after* hooks and a special DiscussionWorflow with a
> notifySuccess method which does its thing?  Yuck, on second thoughts,
> maybe not.  Don't have any bright ideas apart from that.  Good luck!

Idea off top of head:

How about, in _createDiscussionForContent doing something (evil?) like:

content._normal_edit = content.edit
content.edit = discussion_edit

where discussion_edit is defined as:

def discussion_edit(content,*args,**kw):
   result = apply(content._normal_edit,args,kw)
   # do metadata stuff here
   return result

Would that work?
Is it wise?

How would it break?

Chris