Re: [Zope3-Users] Name chooser and Renaming

2007-01-10 Thread David Johnson
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@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Name chooser and Renaming

2007-01-10 Thread Marius Gedminas
On Mon, Jan 08, 2007 at 06:24:17PM +0100, 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.

All containers use name choosers.

Some containers use a name chooser to select a default name, but let the
user override it.  Other containers always use a name chooser and never
let you specify your own name.  IContainerNamesContainer indicates that
you have a container of the second kind.

I hope this clears things up for you.

Marius Gedminas
-- 
My opinions may have changed, but not the fact that I'm right!


signature.asc
Description: Digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users