Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
6bef463e
Commit
6bef463e
authored
Nov 16, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix acquisition on values got by getattr
parent
22754773
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
product/ERP5Type/Core/ERP5PersistentMappingFolder.py
product/ERP5Type/Core/ERP5PersistentMappingFolder.py
+12
-5
No files found.
product/ERP5Type/Core/ERP5PersistentMappingFolder.py
View file @
6bef463e
...
@@ -36,12 +36,10 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
...
@@ -36,12 +36,10 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
def
__getattr__
(
self
,
name
):
def
__getattr__
(
self
,
name
):
if
self
.
_object_dict
is
None
:
if
self
.
_object_dict
is
None
:
LOG
(
"### self._object_dict is None"
,
0
,
''
)
raise
AttributeError
(
name
)
raise
AttributeError
(
name
)
try
:
try
:
return
self
.
_object_dict
[
name
]
return
self
.
_object_dict
[
name
]
.
__of__
(
self
)
except
KeyError
:
except
KeyError
:
LOG
(
"### KeyError for key "
+
name
+
" not in:"
,
0
,
self
.
_object_dict
)
raise
AttributeError
(
name
)
raise
AttributeError
(
name
)
def
__len__
(
self
):
def
__len__
(
self
):
...
@@ -60,6 +58,8 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
...
@@ -60,6 +58,8 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
self
.
_object_dict
[
object_id
]
=
object_value
self
.
_object_dict
[
object_id
]
=
object_value
def
_delOb
(
self
,
object_id
):
def
_delOb
(
self
,
object_id
):
if
self
.
_object_dict
is
None
:
raise
KeyError
,
object_id
del
self
.
_object_dict
[
object_id
]
del
self
.
_object_dict
[
object_id
]
def
_getOb
(
self
,
object_id
,
default
=
_marker
):
def
_getOb
(
self
,
object_id
,
default
=
_marker
):
...
@@ -77,6 +77,8 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
...
@@ -77,6 +77,8 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
def
objectIds
(
self
,
spec
=
None
,
**
kw
):
def
objectIds
(
self
,
spec
=
None
,
**
kw
):
# we don't plan to use meta_type now, so spec is just here for compatibility
# we don't plan to use meta_type now, so spec is just here for compatibility
assert
(
spec
is
None
)
assert
(
spec
is
None
)
if
self
.
_object_dict
is
None
:
return
[]
return
self
.
_object_dict
.
keys
()
return
self
.
_object_dict
.
keys
()
def
objectCount
(
self
):
def
objectCount
(
self
):
...
@@ -84,7 +86,7 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
...
@@ -84,7 +86,7 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
def
objectItems
(
self
,
spec
=
None
):
def
objectItems
(
self
,
spec
=
None
):
assert
(
spec
is
None
)
assert
(
spec
is
None
)
return
self
.
_object_dict
return
self
.
_object_dict
.
items
()
def
objectIds_d
(
self
,
t
=
None
):
def
objectIds_d
(
self
,
t
=
None
):
assert
(
t
is
None
)
assert
(
t
is
None
)
...
@@ -97,7 +99,12 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
...
@@ -97,7 +99,12 @@ class ERP5PersistentMappingFolder(PortalFolderBase):
# Returns list of objects contained in this folder.
# Returns list of objects contained in this folder.
# (no docstring to prevent publishing)
# (no docstring to prevent publishing)
#assert(spec is None)
#assert(spec is None)
if
spec
is
not
None
:
if
isinstance
(
spec
,
str
):
spec
=
(
spec
,)
# hack to get the portal type for a specified meta_type
portal_type
=
[
meta_type
[
5
:]
for
meta_type
in
spec
if
meta_type
.
startswith
(
'ERP5 '
)]
if
self
.
_object_dict
is
None
:
if
self
.
_object_dict
is
None
:
return
[]
return
[]
...
...
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