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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
5ae33020
Commit
5ae33020
authored
Dec 15, 2015
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accessors: Return the default value of the Property which is acquired.
Rather than the acquired Property.
parent
15805d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
product/ERP5Type/Accessor/ContentProperty.py
product/ERP5Type/Accessor/ContentProperty.py
+6
-2
No files found.
product/ERP5Type/Accessor/ContentProperty.py
View file @
5ae33020
...
...
@@ -156,12 +156,16 @@ class Getter(Base.Getter):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
# We return the first available object in the list
if
args
:
default_result
=
args
[
0
]
else
:
default_result
=
self
.
_default
o
=
None
for
k
in
self
.
_storage_id_list
:
o
=
getattr
(
instance
,
k
,
None
)
if
o
is
not
None
and
o
.
portal_type
in
self
.
_portal_type
:
return
o
.
getProperty
(
self
.
_acquired_property
,
*
args
,
**
kw
)
return
args
[
0
]
if
args
else
self
.
_defa
ult
return
o
.
getProperty
(
self
.
_acquired_property
,
default_result
,
**
kw
)
return
default_res
ult
psyco
.
bind
(
__call__
)
...
...
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