Simple useful events

Rocky Burt <[email protected]> Sun, 27 Aug 2006 12:17:57 -0230
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Organization ServerZen Software
Message-ID <1156690077.8279.169.camel@localhost>
Hi all,

I was wondering if anyone would mind if I applied the attached patch to
the AT 1.4 branch.  The change would be sooooo small yet soooo useful.
I'm sick and tired of monkey'ing AT 1.3 and 1.4 to do this on my own
customer projects.

Questions? Comments?

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net


Index: BaseObject.py
===================================================================
--- BaseObject.py       (revision 6809)
+++ BaseObject.py       (working copy)
@@ -57,6 +57,8 @@

 from Products.Archetypes.interfaces import IBaseObject
 from zope.interface import implements
+from zope import event
+from zope.app.event import objectevent

 _marker = []

@@ -647,8 +649,10 @@

         # Post create/edit hooks
         if is_new_object:
+            event.notify(objectevent.ObjectCreatedEvent(self))
             self.at_post_create_script()
         else:
+            event.notify(objectevent.ObjectModifiedEvent(self))
             self.at_post_edit_script()

     # This method is only called once after object creation.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Archetypes-devel mailing list
Archetypes-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/archetypes-devel
signature.asc (application/pgp-signature, 191 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBE8bCd1PysfgyHvo0RAhdeAJwI/J1ClOhZxFPw1B8Bzqhxj5pkSACfe49I
x+cQB5S1asq51mUsGb7FIU0=
=6Z7m
-----END PGP SIGNATURE-----