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

Jim Fulton jim at zope.com
Fri Sep 12 15:15:58 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	delete.py put.py 
Log Message:
Can't have the tests passing, can we?

=== Zope3/src/zope/app/http/delete.py 1.3.22.1 => 1.3.22.2 ===
--- Zope3/src/zope/app/http/delete.py:1.3.22.1	Mon Sep  8 14:21:39 2003
+++ Zope3/src/zope/app/http/delete.py	Fri Sep 12 15:15:27 2003
@@ -19,7 +19,6 @@
 
 from zope.component import getAdapter
 from zope.app.interfaces.file import IWriteDirectory
-from zope.app.interfaces.container import IRemoveSource
 
 class DELETE:
     """Delete handler for all objects
@@ -40,11 +39,7 @@
         # Get a "directory" surrogate for the container
         dir = getAdapter(container, IWriteDirectory)
 
-        # Get the zope adapter for that
-        dir = getAdapter(dir, IRemoveSource)
-
-        # Now do the delete
-        dir.removeObject(name)
+        del dir[name]
 
         return ''
 


=== Zope3/src/zope/app/http/put.py 1.6.24.1 => 1.6.24.2 ===
--- Zope3/src/zope/app/http/put.py:1.6.24.1	Mon Sep  8 14:21:39 2003
+++ Zope3/src/zope/app/http/put.py	Fri Sep 12 15:15:27 2003
@@ -20,7 +20,6 @@
 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 IAddTarget
 from zope.app.event import publish
 from zope.app.event.objectevent import ObjectCreatedEvent
 from zope.interface import implements
@@ -69,9 +68,6 @@
         # Get a "directory" surrogate for the container
         dir = queryAdapter(container, IWriteDirectory)
 
-        # Get the zope adapter for that
-        dir = getAdapter(dir, IAddTarget)
-
         # Now try to get a custom factory for he container
         factory = queryNamedAdapter(container, IFileFactory, ext)
 
@@ -84,7 +80,8 @@
 
         newfile = factory(name, request.getHeader('content-type', ''), data)
         publish(self.context, ObjectCreatedEvent(newfile))
-        dir.addObject(name, newfile)
+
+        dir[name] = newfile
 
         request.response.setStatus(201)
         return ''




More information about the Zope3-Checkins mailing list