[Zope3-dev] Rename, Move, Copy, .... Restore
Jim Fulton
jim@zope.com
Thu, 12 Jun 2003 13:38:42 -0400
Here's another use case. We back up an object tree with fssync
and later want to restore it, possibly in a different location.
This is a lot like copying. We may need to update various
location-dependent information.
Perhaps this could be handled by some variation on the copied
method I mentioned in an earlier note:
>
> and extending IObjectCopier with a copied method::
>
> def copied(source, oldname, target, newname):
> """Notify an object that it has been copied
> """
>
> The copied method will call the manage_afterAdd method on an
> I(Add|Copy)Notifiable adapter of the object. The method is also
> responsible for publishing an IObjectCopied event in the context of
> the original container. Finally, it should recheck any containment
> constraints, in case the containment is not permitted in the new
> location for security reasons.
except that, in this use case, the source may not exist.
Perhaps copied should take paths:
def copied(oldpath, newpath):
"""Notify an object that it has been copied
"""
If the source does exist, we can always get it by traversing the
old path.
Hm.
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (703) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org