RE: manage_after* with Copy/Cut/Paste
Matt, The manage_afterAdd is called after a paste, because essentially, the object has just been added. And likewise, manage_beforeDelete is called before on the object being Cut (if it is cut). Tim
Message: 11 Date: Tue, 24 Jul 2001 12:07:06 +0100 (BST) From: Matt Hamilton <matth@netsight.co.uk> To: <zope-dev@zope.org> Subject: [Zope-dev] manage_after* with Copy/Cut/Paste
Dear All, I have been looking at the CopySupport.py file to try and work out why when I move an instance of a product I have created in the ZMI, the ZCatalog is not updated (the class subclasses CatalogAware). From what I can see when you do a paste after copy the manage_afterClone hook is called, but when a paste after cut is done, no hook is called. This means there is no hook for CatalogAware (or anything else) to hook into. Is this a design oversight, or is there a reason for this, or am I missing something completely?
-Matt
-- Matt Hamilton matth@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Hosting | Web Design | Domain Names | Co-location | DB Integration
Tim McLaughlin wrote:
Matt, The manage_afterAdd is called after a paste, because essentially, the object has just been added. And likewise, manage_beforeDelete is called before on the object being Cut (if it is cut).
And with the recent changes (which I'd like to see reverted), with a rename, manage_beforeDelete is called *after* manage_afterAdd, and what's worse, manage_beforeDelete receives the item with the changed id already. :) Regards, Martijn
Martijn Faassen wrote:
And with the recent changes (which I'd like to see reverted), with a rename, manage_beforeDelete is called *after* manage_afterAdd, and what's worse, manage_beforeDelete receives the item with the changed id already. :)
By the looks of it, this would break ZPatterns copy/paste/rename support if you're using Folder w/ Customizer Support. Martijn, have you put this into the Collector? If not, please do so! Thanks. -- Steve Alexander
Steve Alexander wrote:
Martijn Faassen wrote:
And with the recent changes (which I'd like to see reverted), with a rename, manage_beforeDelete is called *after* manage_afterAdd, and what's worse, manage_beforeDelete receives the item with the changed id already. :)
By the looks of it, this would break ZPatterns copy/paste/rename support if you're using Folder w/ Customizer Support.
Martijn, have you put this into the Collector? If not, please do so!
I cc-ed to the perpetrator, Chris McDonough he seems onto the case. For redundancy I'll put it in the Collector as well, if it isn't there yet. Regards, Martijn
participants (3)
-
Martijn Faassen -
Steve Alexander -
Tim McLaughlin