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
5b6e5755
Commit
5b6e5755
authored
Apr 06, 2024
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
May 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Type: use Getter base accessor class as Tester's super class.
so that Tester methods will have some __roles__ as Getter.
parent
82d58703
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
16 deletions
+7
-16
product/ERP5Form/PreferenceTool.py
product/ERP5Form/PreferenceTool.py
+2
-2
product/ERP5Type/Accessor/Base.py
product/ERP5Type/Accessor/Base.py
+1
-10
product/ERP5Type/Accessor/Content.py
product/ERP5Type/Accessor/Content.py
+1
-1
product/ERP5Type/Accessor/ContentProperty.py
product/ERP5Type/Accessor/ContentProperty.py
+1
-1
product/ERP5Type/Accessor/Translation.py
product/ERP5Type/Accessor/Translation.py
+2
-2
No files found.
product/ERP5Form/PreferenceTool.py
View file @
5b6e5755
...
...
@@ -31,7 +31,7 @@ from AccessControl import ClassSecurityInfo
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
setSecurityManager
,
newSecurityManager
from
AccessControl.ZopeGuards
import
guarded_getattr
from
MethodObject
import
Method
from
Products.ERP5Type.Accessor.Base
import
Getter
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
from
zLOG
import
LOG
,
PROBLEM
...
...
@@ -54,7 +54,7 @@ class Priority:
class
func_code
:
pass
class
PreferenceMethod
(
Method
):
class
PreferenceMethod
(
Getter
):
""" A method object that lookup the attribute on preferences. """
# This is required to call the method form the Web
__code__
=
func_code
=
func_code
()
...
...
product/ERP5Type/Accessor/Base.py
View file @
5b6e5755
...
...
@@ -203,19 +203,10 @@ class Getter(Method):
return
getattr
(
roles
,
'__of__'
,
lambda
aq_parent
:
roles
)(
self
)
class
Tester
(
Method
):
class
Tester
(
Getter
):
"""
Tests if an attribute value exists
"""
_need__name__
=
1
# Generic Definition of Method Object
# This is required to call the method form the Web
__code__
=
func_code
=
func_code
()
__code__
.
co_varnames
=
(
'self'
,)
__code__
.
co_argcount
=
1
__defaults__
=
func_defaults
=
()
def
__init__
(
self
,
id
,
key
,
property_type
,
storage_id
=
None
):
self
.
_id
=
id
self
.
__name__
=
id
...
...
product/ERP5Type/Accessor/Content.py
View file @
5b6e5755
...
...
@@ -208,7 +208,7 @@ class ListGetter(Base.Getter):
DefaultGetter
=
Getter
class
Tester
(
Method
):
class
Tester
(
Base
.
Tester
):
"""
Tests if an attribute value exists
"""
...
...
product/ERP5Type/Accessor/ContentProperty.py
View file @
5b6e5755
...
...
@@ -267,7 +267,7 @@ class ListGetter(Base.Getter):
DefaultGetter
=
Getter
class
Tester
(
Method
):
class
Tester
(
Base
.
Tester
):
"""
Tests if an attribute value exists
"""
...
...
product/ERP5Type/Accessor/Translation.py
View file @
5b6e5755
...
...
@@ -31,7 +31,7 @@ from zLOG import LOG
from
Products.ERP5Type.PsycoWrapper
import
psyco
from
Acquisition
import
aq_base
from
Products.ERP5Type.Accessor.Base
import
func_code
,
ATTRIBUTE_PREFIX
,
evaluateTales
,
Getter
as
BaseGetter
,
Method
from
Products.ERP5Type.Accessor.Base
import
func_code
,
ATTRIBUTE_PREFIX
,
evaluateTales
,
Getter
as
BaseGetter
,
Setter
as
BaseSetter
,
Tester
as
BaseTester
from
Products.ERP5Type.Accessor
import
Accessor
,
AcquiredProperty
from
Products.ERP5Type.Accessor.TypeDefinition
import
type_definition
from
Products.ERP5Type.Utils
import
unicode2str
...
...
@@ -218,7 +218,7 @@ class AcquiredPropertyGetter(AcquiredProperty.Getter):
else
:
return
default
class
TranslatedPropertyTester
(
Method
):
class
TranslatedPropertyTester
(
BaseTester
):
"""
Tests if an attribute value exists
"""
...
...
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