[Zope3-checkins] CVS: Zope3/src/zope/app/http - put.py:1.7
Jim Fulton
jim at zope.com
Sun Sep 21 13:32:45 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/http
In directory cvs.zope.org:/tmp/cvs-serv14092/src/zope/app/http
Modified Files:
put.py
Log Message:
Changed to use __setitem__ rather than setObject
No longer use the zope container adapter.
=== Zope3/src/zope/app/http/put.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/http/put.py:1.6 Fri Jun 6 16:55:09 2003
+++ Zope3/src/zope/app/http/put.py Sun Sep 21 13:32:14 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 IZopeWriteContainer
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, IZopeWriteContainer)
-
# 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.setObject(name, newfile)
+
+ dir[name] = newfile
request.response.setStatus(201)
return ''
More information about the Zope3-Checkins
mailing list