On Sunday 22 January 2006 18:03, David Johnson wrote:
> I'm implemented NameChooser similarly to Phillip's book.  It works great
> except when I edit - name changes do not take effect. For example, if I
> added an object with a name like "BBQ", and then later edit it and change
> it to "BBQ Chicken", the name of the object stays "BBQ", although the name
> attribute becomes "BBQ Chicken".

The namechooser is *only* invoked during *adding*.

> When a form is added, the ZCML directive "set_before_add" works. Is there a
> similar one for "browser:editform"?   Is there another approach that is
> recommended?

The right way to handle this is to have a subscriber that listens to 
IObjectAddedEvent events and if the name changes, you basically do also a 
move from the old __name__ to a new computed one.

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-users mailing list

Reply via email to