[Product-Developers] Re: Post-create update of a reference field

Maurits van Rees m.van.rees at zestsoftware.nl
Thu Jun 11 09:52:16 UTC 2009

Andreas Jung, on 2009-06-11:
>> Register a zope 3 event handler for the sub event type and
>> Products.Archetypes.interfaces.IObjectInitializedEvent
>> In that handler check if the parent of the object is an instance of
>> your AT-Event derived content-type and set the reference field.
> Object subscriber won't work because the events aren't nested and the
> parent container
> does not know about the original object :-)

Ah, right, I thought you had folderish event types and were creating a
sub event inside an event.

Hm, perhaps you can pass a parameter like came_from to the link to
portal factory and hook that into the edit form of the object; then
look for that parameter in the zope 3 event handler.

The archetypes edit form has some slots that you can file, like
extra_bottom.  If you fill that slot with some template code that
checks for a came_from parameter (or just checks for a default request
parameter) it might work.

Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]

More information about the Product-Developers mailing list