[Zope3-dev] Renaming an object vs moving it

Garrett Smith garrett at mojave-corp.com
Mon Feb 7 14:25:12 EST 2005


Garrett Smith wrote:
> Jürgen Kartnaller brought up an issue with copypastemove.rename and
> its effect on ordered containers. rename uses an IObjectMover, which
> removes an item and then adds it back to its container. For ordered
> containers, this has the effect of moving the item to the last
> position of the container.
> 
> I'm wondering if a rename should have the full effect of removing an
> item from its container and then adding it again -- with all the
> related object events being fired.
> 
> Alternatively, we could fire a single ObjectRenamedEvent, which
> extends ObjectMovedEvent. I think this is more accurate than separate
> remove and add events.

Forget this -- I wasn't thinking straight. There's only a single
ObjectMovedEvent fired in such cases, which is sufficient for
determining a 'rename' operation (event.oldParent == event.newParent).

 -- Garrett


More information about the Zope3-dev mailing list