[Zope3-Users] Name chooser and Renaming
David Johnson
djohnson at jsatech.com
Wed Jan 10 06:03:14 EST 2007
Okay. Since I didn't get a response I assumed no one else knew
either. I figured out the following:
1. Since I have a custom container that is derived from IContainer,
it is already configured as a IContainerNamesContainer, and if I
override chooseName() and checkName(), I get the desired effect of
choosing my own names.
2. I did not adapt my container to IContainerNamesContainer, and so
Rename is now enabled. This I do not understand, but it works.
3. I put a custom template in the browser:addform directive. The
template was a copy of the zope.app.form.browser.add template, but I
edited out the "Object Name" field.
I have the desired effect. All seems to work very well.
On Jan 8, 2007, at 6:24 PM, David Johnson wrote:
> Is it possible to have both a NameChooser and an ObjectRenamer. If
> so...how? It seems that zope.app.container.browser contents.py has
> the following code:
>
> self.supportsRename = (
> self.supportsCut and
> not IContainerNamesContainer.providedBy(self.context)
> )
>
> So if you have a name chooser then you cannot rename. I would like
> users to be able to choose the name of object (within certain basic
> restrictions which is why I want the name chooser), and then be
> able to rename the object within the same conditions.
>
> Thoughts?
>
> --
> David
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
More information about the Zope3-users
mailing list