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
700675ee
Commit
700675ee
authored
Dec 06, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: PERF: list comprehension instead of appending objects
parent
9187326b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+1
-5
product/ERP5Workflow/Document/Worklist.py
product/ERP5Workflow/Document/Worklist.py
+4
-3
No files found.
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
700675ee
...
...
@@ -210,11 +210,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
security
.
declarePrivate
(
'getTransitionIdList'
)
def
getTransitionIdList
(
self
):
id_list
=
[]
append
=
id_list
.
append
for
ob
in
self
.
objectValues
(
portal_type
=
"Interaction"
):
append
(
ob
.
getReference
())
return
id_list
return
[
ob
.
getReference
()
for
ob
in
self
.
objectValues
(
portal_type
=
"Interaction"
)]
security
.
declarePrivate
(
'notifyWorkflowMethod'
)
def
notifyWorkflowMethod
(
self
,
ob
,
transition_list
,
args
=
None
,
kw
=
None
):
...
...
product/ERP5Workflow/Document/Worklist.py
View file @
700675ee
...
...
@@ -142,9 +142,10 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject,
key_list.append('
validation_state
')
if self.getMatchedCausalityState():
key_list.append('
causality_state
')
for dynamic_variable in self.objectValues():
if dynamic_variable.getVariableValue() or dynamic_variable.getVariableExpression():
key_list.append(dynamic_variable.getReference())
key_list += [dynamic_variable.getReference() for dynamic_variable in self.objectValues()
if dynamic_variable.getVariableValue() or dynamic_variable.getVariableExpression()]
return key_list
security.declareProtected(Permissions.AccessContentsInformation,
...
...
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