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
Labels
Merge Requests
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
e60fe89f
Commit
e60fe89f
authored
May 15, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complain about unsupported parameters in get*Related* accessors
Ideally the signature of accessor should be more strict
parent
8ba86f1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
product/ERP5Type/Accessor/Related.py
product/ERP5Type/Accessor/Related.py
+4
-0
product/ERP5Type/Accessor/RelatedValue.py
product/ERP5Type/Accessor/RelatedValue.py
+8
-0
No files found.
product/ERP5Type/Accessor/Related.py
View file @
e60fe89f
...
@@ -54,6 +54,8 @@ class DefaultGetter(BaseGetter):
...
@@ -54,6 +54,8 @@ class DefaultGetter(BaseGetter):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
if
self
.
_warning
:
if
self
.
_warning
:
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
assert
not
'validation_state'
in
kw
,
"validation_state parameter is not supported"
assert
not
'simulation_state'
in
kw
,
"simulation_state parameter is not supported"
return
instance
.
_getDefaultRelatedProperty
(
return
instance
.
_getDefaultRelatedProperty
(
self
.
_key
,
'relative_url'
,
self
.
_key
,
'relative_url'
,
spec
=
kw
.
get
(
'spec'
,()),
spec
=
kw
.
get
(
'spec'
,()),
...
@@ -87,6 +89,8 @@ class ListGetter(BaseGetter):
...
@@ -87,6 +89,8 @@ class ListGetter(BaseGetter):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
if
self
.
_warning
:
if
self
.
_warning
:
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
assert
not
'validation_state'
in
kw
,
"validation_state parameter is not supported"
assert
not
'simulation_state'
in
kw
,
"simulation_state parameter is not supported"
return
instance
.
_getRelatedPropertyList
(
return
instance
.
_getRelatedPropertyList
(
self
.
_key
,
'relative_url'
,
self
.
_key
,
'relative_url'
,
spec
=
kw
.
get
(
'spec'
,()),
spec
=
kw
.
get
(
'spec'
,()),
...
...
product/ERP5Type/Accessor/RelatedValue.py
View file @
e60fe89f
...
@@ -58,6 +58,8 @@ class DefaultGetter(BaseGetter):
...
@@ -58,6 +58,8 @@ class DefaultGetter(BaseGetter):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
if
self
.
_warning
:
if
self
.
_warning
:
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
assert
not
'validation_state'
in
kw
,
"validation_state parameter is not supported"
assert
not
'simulation_state'
in
kw
,
"simulation_state parameter is not supported"
return
instance
.
_getDefaultRelatedValue
(
return
instance
.
_getDefaultRelatedValue
(
self
.
_key
,
self
.
_key
,
spec
=
kw
.
get
(
'spec'
,()),
spec
=
kw
.
get
(
'spec'
,()),
...
@@ -96,6 +98,8 @@ class ListGetter(BaseGetter):
...
@@ -96,6 +98,8 @@ class ListGetter(BaseGetter):
self
.
_warning
=
warning
self
.
_warning
=
warning
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
assert
not
'validation_state'
in
kw
,
"validation_state parameter is not supported"
assert
not
'simulation_state'
in
kw
,
"simulation_state parameter is not supported"
if
self
.
_warning
:
if
self
.
_warning
:
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
return
instance
.
_getRelatedValueList
(
self
.
_key
,
*
args
,
**
kw
)
return
instance
.
_getRelatedValueList
(
self
.
_key
,
*
args
,
**
kw
)
...
@@ -134,6 +138,8 @@ class DefaultPropertyGetter(BaseGetter):
...
@@ -134,6 +138,8 @@ class DefaultPropertyGetter(BaseGetter):
def
__call__
(
self
,
instance
,
key
,
*
args
,
**
kw
):
def
__call__
(
self
,
instance
,
key
,
*
args
,
**
kw
):
if
self
.
_warning
:
if
self
.
_warning
:
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
assert
not
'validation_state'
in
kw
,
"validation_state parameter is not supported"
assert
not
'simulation_state'
in
kw
,
"simulation_state parameter is not supported"
return
instance
.
_getDefaultRelatedProperty
(
return
instance
.
_getDefaultRelatedProperty
(
self
.
_key
,
key
,
self
.
_key
,
key
,
spec
=
kw
.
get
(
'spec'
,()),
spec
=
kw
.
get
(
'spec'
,()),
...
@@ -169,6 +175,8 @@ class PropertyListGetter(BaseGetter):
...
@@ -169,6 +175,8 @@ class PropertyListGetter(BaseGetter):
def
__call__
(
self
,
instance
,
key
,
*
args
,
**
kw
):
def
__call__
(
self
,
instance
,
key
,
*
args
,
**
kw
):
if
self
.
_warning
:
if
self
.
_warning
:
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
LOG
(
"ERP5Type"
,
WARNING
,
"Deprecated Getter Id: %s"
%
self
.
_id
)
assert
not
'validation_state'
in
kw
,
"validation_state parameter is not supported"
assert
not
'simulation_state'
in
kw
,
"simulation_state parameter is not supported"
return
instance
.
_getRelatedPropertyList
(
return
instance
.
_getRelatedPropertyList
(
self
.
_key
,
key
,
self
.
_key
,
key
,
spec
=
kw
.
get
(
'spec'
,()),
spec
=
kw
.
get
(
'spec'
,()),
...
...
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