[Zope3-dev] ObjectMover events

Florent Guillaume fg at nuxeo.com
Thu Dec 1 08:53:30 EST 2005


> I dont' know if this affect the events itself but there is also a 
> problem in the ObjectMover.
> 
> If you use the ObjectMover from copypastemove on IDependable (registered) 
> objects, it's not possible to move a object because of the order the move 
> process is implemented.
> 
> ---
> target[new_name] = obj
> del container[orig_name]

Doh. I hadn't looked at that code.

> if the ObjectAdded Event will add a dependency to the object we can't 
> delete them in the container.
> 
> If this should be fixed, I'm not sure if the ObjectMover should copy
> dependable objects, then the order should be:
> 
> ---
> del container[orig_name]
> target[new_name] = obj
> 
> 
> This means the events order in this usecase looks like:
> 
> IObjectRemovedEvent
> IObjectAddedEvent
> IObjectMovedEvent
> 
> Where the IObjectMovedEvent notifies about the sucessful move.
> Anyway, add a object to a container where is at the same time in
> a second container is a bad idea in my point of view.

I think ObjectMover doesn't care about events but it should. It should do 
whatever is necessary so that only one IObjectMovedEvent is generated. I'll 
look at that.

(Note that in Zope 2.9 I'm already generating a proper single event on a move :)

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope3-dev mailing list