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
d8a09793
Commit
d8a09793
authored
Aug 07, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged fix for recursive calls to acquired manage_after* methods from 2.2
branch
parent
855c1281
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+15
-15
No files found.
lib/python/OFS/ObjectManager.py
View file @
d8a09793
...
...
@@ -84,9 +84,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.10
4 2000/08/07 18:45:56 shane
Exp $"""
$Id: ObjectManager.py,v 1.10
5 2000/08/07 19:22:41 brian
Exp $"""
__version__
=
'$Revision: 1.10
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.10
5
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
Globals
,
CopySupport
,
Products
import
os
,
App
.
FactoryDispatcher
,
ts_regex
,
Products
...
...
@@ -94,6 +94,7 @@ from Globals import HTMLFile, HTMLFile, Persistent
from
Globals
import
MessageDialog
,
default__class_init__
from
webdav.NullResource
import
NullResource
from
webdav.Collection
import
Collection
from
Acquisition
import
aq_base
from
urllib
import
quote
from
cStringIO
import
StringIO
import
marshal
...
...
@@ -230,8 +231,7 @@ class ObjectManager(
if
flag
==
UNIQUE
:
raise
'Bad Request'
,
\
(
'The id "%s" is reserved by another object.'
%
id
)
base
=
getattr
(
self
,
'aq_base'
,
self
)
if
hasattr
(
base
,
id
):
if
hasattr
(
aq_base
(
self
),
id
):
# The object is located in this ObjectManager.
if
flag
!=
REPLACEABLE
:
raise
'Bad Request'
,
(
'The id "%s" is invalid - '
\
...
...
@@ -246,10 +246,7 @@ class ObjectManager(
def
_setOb
(
self
,
id
,
object
):
setattr
(
self
,
id
,
object
)
def
_delOb
(
self
,
id
):
delattr
(
self
,
id
)
def
_getOb
(
self
,
id
,
default
=
_marker
):
if
hasattr
(
self
,
'aq_base'
):
base
=
self
.
aq_base
else
:
base
=
self
if
not
hasattr
(
base
,
id
):
if
not
hasattr
(
aq_base
(
self
),
id
):
if
default
is
_marker
:
raise
AttributeError
,
id
return
default
...
...
@@ -292,14 +289,16 @@ class ObjectManager(
for
object
in
self
.
objectValues
():
try
:
s
=
object
.
_p_changed
except
:
s
=
0
object
.
manage_afterAdd
(
item
,
container
)
if
hasattr
(
aq_base
(
object
),
'manage_afterAdd'
):
object
.
manage_afterAdd
(
item
,
container
)
if
s
is
None
:
object
.
_p_deactivate
()
def
manage_afterClone
(
self
,
item
):
for
object
in
self
.
objectValues
():
try
:
s
=
object
.
_p_changed
except
:
s
=
0
object
.
manage_afterClone
(
item
)
if
hasattr
(
aq_base
(
object
),
'manage_afterClone'
):
object
.
manage_afterClone
(
item
)
if
s
is
None
:
object
.
_p_deactivate
()
def
manage_beforeDelete
(
self
,
item
,
container
):
...
...
@@ -307,7 +306,8 @@ class ObjectManager(
try
:
s
=
object
.
_p_changed
except
:
s
=
0
try
:
object
.
manage_beforeDelete
(
item
,
container
)
if
hasattr
(
aq_base
(
object
),
'manage_beforeDelete'
):
object
.
manage_beforeDelete
(
item
,
container
)
except
BeforeDeleteException
,
ob
:
raise
except
:
...
...
@@ -461,9 +461,10 @@ class ObjectManager(
def
tpValues
(
self
):
# Return a list of subobjects, used by tree tag.
r
=
[]
if
hasattr
(
self
.
aq_base
,
'tree_ids'
):
for
id
in
self
.
aq_base
.
tree_ids
:
if
hasattr
(
self
,
id
):
r
.
append
(
self
.
_getOb
(
id
))
if
hasattr
(
aq_base
(
self
),
'tree_ids'
):
for
id
in
self
.
tree_ids
:
if
hasattr
(
self
,
id
):
r
.
append
(
self
.
_getOb
(
id
))
else
:
for
id
in
self
.
_objects
:
o
=
self
.
_getOb
(
id
[
'id'
])
...
...
@@ -498,7 +499,6 @@ class ObjectManager(
XMLExportImport
.
exportXML
(
ob
.
_p_jar
,
ob
.
_p_oid
,
f
)
else
:
ob
.
_p_jar
.
exportFile
(
ob
.
_p_oid
,
f
)
if
RESPONSE
is
not
None
:
return
MessageDialog
(
title
=
"Object exported"
,
...
...
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