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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
5b174fa5
Commit
5b174fa5
authored
Oct 10, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: PERF: change getter for categories used in workflow
parent
47a6f5e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
product/ERP5Workflow/Document/Interaction.py
product/ERP5Workflow/Document/Interaction.py
+28
-0
product/ERP5Workflow/Document/Transition.py
product/ERP5Workflow/Document/Transition.py
+26
-0
No files found.
product/ERP5Workflow/Document/Interaction.py
View file @
5b174fa5
...
...
@@ -75,3 +75,31 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject,
PropertySheet
.
Interaction
,
PropertySheet
.
Guard
,
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBeforeCommitScriptIdList'
)
def
getBeforeCommitScriptIdList
(
self
):
"""
redefine this getter for performance improvements:
instead of , from the portal, getting the workflow
and taking its script or transition, and repeting this for
all 'before commit script', just get the parent once
and find the script names from the category paths
"""
parent
=
self
.
getParentValue
()
return
[
parent
.
_getOb
(
path
.
split
(
'/'
)[
-
1
])
for
path
in
self
.
getBeforeCommitScriptList
()]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getActivateScriptIdList'
)
def
getActivateScriptIdList
(
self
):
"""
redefine this getter for performance improvements:
instead of , from the portal, getting the workflow
and taking its script or transition, and repeting this for
all 'activate script', just get the parent once
and find the script names from the category paths
"""
parent
=
self
.
getParentValue
()
return
[
parent
.
_getOb
(
path
.
split
(
'/'
)[
-
1
])
for
path
in
self
.
getActivateScriptList
()]
product/ERP5Workflow/Document/Transition.py
View file @
5b174fa5
...
...
@@ -77,3 +77,29 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
PropertySheet
.
Guard
,
PropertySheet
.
ActionInformation
,
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBeforeScriptIdList'
)
def
getBeforeScriptIdList
(
self
):
"""
redefine this getter for performance improvements:
instead of , from the portal, getting the workflow
and taking its script or transition, and repeting this for
all 'before script', just get the parent once
and find the script names from the category paths
"""
return
[
self
.
getParentValue
().
_getOb
(
path
.
split
(
'/'
)[
-
1
])
for
path
in
self
.
getBeforeScriptList
()]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getAfterScriptIdList'
)
def
getAfterScriptIdList
(
self
):
"""
redefine this getter for performance improvements:
instead of , from the portal, getting the workflow
and taking its script or transition, and repeting this for
all 'after script', just get the parent once
and find the script names from the category paths
"""
return
[
self
.
getParentValue
().
_getOb
(
path
.
split
(
'/'
)[
-
1
])
for
path
in
self
.
getAfterScriptList
()]
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