Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nikola Balog
erp5
Commits
5ae33020
Commit
5ae33020
authored
9 years ago
by
Arnaud Fontaine
Browse files
Options
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__
)
...
...
This diff is collapsed.
Click to expand it.
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