Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2b2d7822
Commit
2b2d7822
authored
Jan 15, 2007
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #2261: Acquisition when creating objects via Webdav.
parent
c6810f41
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/ZPublisher/BaseRequest.py
lib/python/ZPublisher/BaseRequest.py
+11
-0
lib/python/webdav/tests/testPUT_factory.py
lib/python/webdav/tests/testPUT_factory.py
+18
-0
No files found.
doc/CHANGES.txt
View file @
2b2d7822
...
@@ -10,6 +10,8 @@ Zope Changes
...
@@ -10,6 +10,8 @@ Zope Changes
- Updated Zope 3 to bugfix release 3.3.1.
- Updated Zope 3 to bugfix release 3.3.1.
- Collector #2261: Acquisition when creating objects via Webdav.
Zope 2.10.2 beta 1 (2007/01/14)
Zope 2.10.2 beta 1 (2007/01/14)
Bugs fixed
Bugs fixed
...
...
lib/python/ZPublisher/BaseRequest.py
View file @
2b2d7822
...
@@ -427,6 +427,17 @@ class BaseRequest:
...
@@ -427,6 +427,17 @@ class BaseRequest:
# BrowserDefault returns the object to be published
# BrowserDefault returns the object to be published
# (usually self) and a sequence of names to traverse to
# (usually self) and a sequence of names to traverse to
# find the method to be published.
# find the method to be published.
# This is webdav support. The last object in the path
# should not be acquired. Instead, a NullResource should
# be given if it doesn't exist:
if
(
no_acquire_flag
and
hasattr
(
object
,
'aq_base'
)
and
not
hasattr
(
object
,
'__bobo_traverse__'
)):
if
object
.
aq_parent
is
not
object
.
aq_inner
.
aq_parent
:
from
webdav.NullResource
import
NullResource
object
=
NullResource
(
parents
[
-
2
],
object
.
getId
(),
self
).
__of__
(
parents
[
-
2
])
if
IBrowserPublisher
.
providedBy
(
object
):
if
IBrowserPublisher
.
providedBy
(
object
):
adapter
=
object
adapter
=
object
else
:
else
:
...
...
lib/python/webdav/tests/testPUT_factory.py
View file @
2b2d7822
...
@@ -27,6 +27,7 @@ class TestPUTFactory(unittest.TestCase):
...
@@ -27,6 +27,7 @@ class TestPUTFactory(unittest.TestCase):
request
[
'BODY'
]
=
'bar'
request
[
'BODY'
]
=
'bar'
request
.
environ
[
'CONTENT_TYPE'
]
=
'text/plain'
request
.
environ
[
'CONTENT_TYPE'
]
=
'text/plain'
request
.
environ
[
'REQUEST_METHOD'
]
=
'PUT'
request
.
environ
[
'REQUEST_METHOD'
]
=
'PUT'
request
.
environ
[
'WEBDAV_SOURCE_PORT'
]
=
1
request
.
_auth
=
auth_info
request
.
_auth
=
auth_info
except
:
except
:
self
.
tearDown
()
self
.
tearDown
()
...
@@ -67,6 +68,23 @@ class TestPUTFactory(unittest.TestCase):
...
@@ -67,6 +68,23 @@ class TestPUTFactory(unittest.TestCase):
put
(
request
,
request
.
RESPONSE
)
put
(
request
,
request
.
RESPONSE
)
self
.
failUnless
(
'doc'
in
self
.
folder
.
objectIds
())
self
.
failUnless
(
'doc'
in
self
.
folder
.
objectIds
())
def
testCollector2261
(
self
):
from
OFS.Folder
import
manage_addFolder
from
OFS.DTMLMethod
import
addDTMLMethod
self
.
app
.
manage_addFolder
(
'A'
,
''
)
addDTMLMethod
(
self
.
app
,
'a'
,
file
=
'I am file a'
)
self
.
app
.
A
.
manage_addFolder
(
'B'
,
''
)
request
=
self
.
app
.
REQUEST
# this should create 'a' within /A/B containing 'bar'
put
=
request
.
traverse
(
'/A/B/a'
)
put
(
request
,
request
.
RESPONSE
)
# PUT should no acquire A.a
self
.
assertEqual
(
str
(
self
.
app
.
A
.
a
),
'I am file a'
,
'PUT factory not should acquire content'
)
# check for the newly created file
self
.
assertEqual
(
str
(
self
.
app
.
A
.
B
.
a
),
'bar'
)
def
test_suite
():
def
test_suite
():
return
unittest
.
TestSuite
((
return
unittest
.
TestSuite
((
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment