Re: Object created events
Martin Aspeli <[email protected]> Mon, 02 Oct 2006 20:20:41 +0100
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
Rocky Burt wrote: > On Mon, 2006-02-10 at 00:35 +0100, Martin Aspeli wrote: >> We have: >> >> - IObjectCreated event is being fired during the generated constructor >> >> --> I don't know how to write a test for this, though, so it's currently >> untested :-( >> >> - IObjectInitializedEvent and IObjectEditedEvent both inherit from >> IObjectModifiedEvent, and are being fired in processForm() when the >> object is first edited (creation flag is set) and when it's subsequently >> edited. > > Sounds good. I'm eagerly awaiting this in 1.4 as I need > IObjectInitializedEvent "right now" :) My branch is against 1.5. Backporting shouldn't be too hard, though backporting the tests is a bit annoying since we'd have to replicate some of the CA set-up/tear-down. I don't have a lot of time this week, so if you're interested in helping with the backport, that'd be nice. The diffs are basically in interfaces/_event.py and associated imports in interfaces/__init__.py, in event.py (where the events are defined), in BaseObject's processForm() and in ClassGen's bad-horribly-exec'd factory method definition. Also, note that for 1.4 we'd need to import from zope.app.event instead of zope.lifecycleevent (they moved). Martin ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV