Commit b6724253 authored by iv's avatar iv

ERP5Workflow: PERF: redefine getDestinationIdList not to use the objects directly

parent 0a361ce6
......@@ -89,6 +89,16 @@ class State(IdAsReferenceMixin("state_", "prefix"), XMLObject, CustomStorageMatr
possible_transition_list.append(tr_path)
self.setCategoryList(possible_transition_list)
security.declareProtected(Permissions.AccessContentsInformation,
'getDestinationIdList')
def getDestinationIdList(self):
"""
this getter is redefined to improve performance:
instead of getting all the transition objects from the destination list
to then use their ids, extract the information from the string
"""
return [path.split('/')[-1] for path in self.getDestinationList()]
def getTransitions(self):
# return possible transition id list:
return self.getDestinationIdList()
......
......@@ -76,4 +76,4 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
PropertySheet.Transition,
PropertySheet.Guard,
PropertySheet.ActionInformation,
)
\ No newline at end of file
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment