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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mukul
erp5
Commits
29457833
Commit
29457833
authored
Nov 27, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Dec 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Formulator] Method name from Method Field is publically available
parent
dd928bbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
product/Formulator/MethodField.py
product/Formulator/MethodField.py
+7
-1
No files found.
product/Formulator/MethodField.py
View file @
29457833
...
...
@@ -4,7 +4,7 @@ import Widget, Validator
from
Persistence
import
Persistent
import
Acquisition
from
Field
import
ZMIField
from
AccessControl
import
getSecurityManager
from
AccessControl
import
getSecurityManager
,
ClassSecurityInfo
class
MethodWidget
(
Widget
.
TextWidget
):
default
=
fields
.
MethodField
(
'default'
,
...
...
@@ -27,9 +27,15 @@ MethodWidgetInstance = MethodWidget()
class
Method
(
Persistent
,
Acquisition
.
Implicit
):
"""A method object; calls method name in acquisition context.
"""
security
=
ClassSecurityInfo
()
def
__init__
(
self
,
method_name
):
self
.
method_name
=
method_name
security
.
declarePublic
(
'getMethodName'
)
def
getMethodName
(
self
):
return
self
.
method_name
def
__call__
(
self
,
*
arg
,
**
kw
):
# get method from acquisition path
method
=
getattr
(
self
,
self
.
method_name
)
...
...
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