[Zope3-checkins] CVS: Zope3/src/zope/app/http - delete.py:1.3.22.1 put.py:1.6.24.1

Jim Fulton jim at zope.com
Mon Sep 8 15:22:10 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/http
In directory cvs.zope.org:/tmp/cvs-serv20092/src/zope/app/http

Modified Files:
      Tag: parentgeddon-branch
	delete.py put.py 
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing.  Specific log entries will be provided
when we merge this into the head.


=== Zope3/src/zope/app/http/delete.py 1.3 => 1.3.22.1 ===
--- Zope3/src/zope/app/http/delete.py:1.3	Mon Jun 23 13:17:04 2003
+++ Zope3/src/zope/app/http/delete.py	Mon Sep  8 14:21:39 2003
@@ -18,9 +18,8 @@
 __metaclass__ = type
 
 from zope.component import getAdapter
-from zope.context import getWrapperContainer, getWrapperData
 from zope.app.interfaces.file import IWriteDirectory
-from zope.app.interfaces.container import IZopeWriteContainer
+from zope.app.interfaces.container import IRemoveSource
 
 class DELETE:
     """Delete handler for all objects
@@ -34,18 +33,18 @@
         request = self.request
 
         victim = self.context
-        container = getWrapperContainer(victim)
-        name = getWrapperData(victim)['name']
+        container = victim.__parent__
+        name = victim.__name__
 
 
         # Get a "directory" surrogate for the container
         dir = getAdapter(container, IWriteDirectory)
 
         # Get the zope adapter for that
-        dir = getAdapter(dir, IZopeWriteContainer)
+        dir = getAdapter(dir, IRemoveSource)
 
         # Now do the delete
-        del dir[name]
+        dir.removeObject(name)
 
         return ''
 


=== Zope3/src/zope/app/http/put.py 1.6 => 1.6.24.1 ===
--- Zope3/src/zope/app/http/put.py:1.6	Fri Jun  6 16:55:09 2003
+++ Zope3/src/zope/app/http/put.py	Mon Sep  8 14:21:39 2003
@@ -20,7 +20,7 @@
 from zope.component import getAdapter, queryAdapter, queryNamedAdapter
 from zope.app.interfaces.http import INullResource
 from zope.app.interfaces.file import IWriteFile, IWriteDirectory, IFileFactory
-from zope.app.interfaces.container import IZopeWriteContainer
+from zope.app.interfaces.container import IAddTarget
 from zope.app.event import publish
 from zope.app.event.objectevent import ObjectCreatedEvent
 from zope.interface import implements
@@ -70,7 +70,7 @@
         dir = queryAdapter(container, IWriteDirectory)
 
         # Get the zope adapter for that
-        dir = getAdapter(dir, IZopeWriteContainer)
+        dir = getAdapter(dir, IAddTarget)
 
         # Now try to get a custom factory for he container
         factory = queryNamedAdapter(container, IFileFactory, ext)
@@ -84,7 +84,7 @@
 
         newfile = factory(name, request.getHeader('content-type', ''), data)
         publish(self.context, ObjectCreatedEvent(newfile))
-        dir.setObject(name, newfile)
+        dir.addObject(name, newfile)
 
         request.response.setStatus(201)
         return ''




More information about the Zope3-Checkins mailing list