[Zope3-Users] Renaming and OrderedContainer

Garrett Smith garrett at mojave-corp.com
Sun Jan 30 12:17:41 EST 2005


jürgen Kartnaller wrote:
> Hello all,
> I found the following problem when renaming objects :
> 
> zope.app.copypastemove.rename uses the ObjectMover to rename an object
> within a container.
> There is no problem as long as you are using BTree containers.
> 
> If rename is used on an OrderedContainer then the object is moved to
> the end of the list because ObjectMover first adds the object with
> the new name to the container (OrderedContainer puts the new object
> to the end of the list) and then deletes the old name.
> 
> To solve this problem a container should have a rename function !

The problem is that copypastemove.rename doesn't use something like
IObjectRenamer. The default implementation of rename works fine for
normal containers, but not for ordered containers.

This would be straight forward to implement, if you're iterested :)

A 'rename' method isn't z3onic (pronounced zee-thronic? ;) We like to
tack on new functionality using the component patterns, which have some
nice advantages over polymorphic methods.

 -- Garrett


More information about the Zope3-users mailing list