[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container - contents.py:1.10

Sidnei da Silva sidnei@x3ng.com.br
Mon, 17 Feb 2003 10:11:09 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv6290/browser/container

Modified Files:
	contents.py 
Log Message:
renamed copy.py to copypastemove.py. fixed rename via zope3 ui. fixed copy.

=== Zope3/src/zope/app/browser/container/contents.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/container/contents.py:1.9	Tue Feb 11 10:59:29 2003
+++ Zope3/src/zope/app/browser/container/contents.py	Mon Feb 17 10:10:39 2003
@@ -26,10 +26,10 @@
 from zope.publisher.browser import BrowserView
 from zope.app.interfaces.traversing import IPhysicallyLocatable
 from zope.app.traversing import traverse, getPhysicalRoot
-from zope.app.interfaces.copy import IPrincipalClipboard
+from zope.app.interfaces.copypastemove import IPrincipalClipboard
 from zope.app.interfaces.container import IPasteTarget
-from zope.app.interfaces.copy import IObjectCopier
-from zope.app.interfaces.copy import IObjectMover
+from zope.app.interfaces.copypastemove import IObjectCopier
+from zope.app.interfaces.copypastemove import IObjectMover
 
 class Contents(BrowserView):
 
@@ -73,8 +73,7 @@
         container = getAdapter(self.context, IZopeContainer)
         for id, newid in zip(ids, newids):
             if newid != id:
-                obj = container[id]
-                getAdapter(obj, IObjectMover).moveTo(container, newid)
+                container.rename(id, newid)
         self.request.response.redirect('@@contents.html')
 
     def removeObjects(self, ids):
@@ -136,6 +135,8 @@
             obj = traverse(container, item['target'])
             if item['action'] == 'cut':
                 getAdapter(obj, IObjectMover).moveTo(target)
+                # XXX need to remove the item from the clipboard here
+                # as it will not be available anymore from the old location
             elif item['action'] == 'copy':
                 getAdapter(obj, IObjectCopier).copyTo(target)
             else: