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
957b2597
Commit
957b2597
authored
Oct 11, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged fix to check for '_' in _getOb
parent
826c60bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+13
-9
No files found.
lib/python/OFS/ObjectManager.py
View file @
957b2597
...
...
@@ -84,9 +84,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.11
2 2000/10/10 18:55:33 ev
an Exp $"""
$Id: ObjectManager.py,v 1.11
3 2000/10/11 17:49:43 bri
an Exp $"""
__version__
=
'$Revision: 1.11
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.11
3
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
Globals
,
CopySupport
,
Products
import
os
,
App
.
FactoryDispatcher
,
ts_regex
,
Products
...
...
@@ -250,11 +250,15 @@ 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
not
hasattr
(
aq_base
(
self
),
id
):
if
default
is
_marker
:
raise
AttributeError
,
id
return
default
return
getattr
(
self
,
id
)
# FIXME: what we really need to do here is ensure that only
# sub-items are returned. That could have a measurable hit
# on performance as things are currently implemented, so for
# the moment we just make sure not to expose private attrs.
if
id
[:
1
]
!=
'_'
and
hasattr
(
aq_base
(
self
),
id
):
return
getattr
(
self
,
id
)
if
default
is
_marker
:
raise
AttributeError
,
id
return
default
def
_setObject
(
self
,
id
,
object
,
roles
=
None
,
user
=
None
,
set_owner
=
1
):
v
=
self
.
_checkId
(
id
)
...
...
@@ -483,7 +487,7 @@ class ObjectManager(
RESPONSE
=
None
):
"""Exports an object to a file and returns that file."""
if
not
id
:
# can
t use getId() here, breaks on "old" objects
# can
't use getId() here (breaks on "old" exported objects)
id
=
self
.
id
if
hasattr
(
id
,
'im_func'
):
id
=
id
()
ob
=
self
...
...
@@ -532,7 +536,7 @@ class ObjectManager(
file
,
customImporters
=
customImporters
)
if
REQUEST
:
self
.
_verifyObjectPaste
(
ob
,
validate_src
=
0
)
#id=ob.getId()
#
can't use above, breaks on "old" imported objects.
#
can't use above getId() call, it fails on 'old' exported objects
id
=
ob
.
id
if
hasattr
(
id
,
'im_func'
):
id
=
id
()
self
.
_setObject
(
id
,
ob
,
set_owner
=
set_owner
)
...
...
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