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 ...@@ -89,6 +89,16 @@ class State(IdAsReferenceMixin("state_", "prefix"), XMLObject, CustomStorageMatr
possible_transition_list.append(tr_path) possible_transition_list.append(tr_path)
self.setCategoryList(possible_transition_list) 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): def getTransitions(self):
# return possible transition id list: # return possible transition id list:
return self.getDestinationIdList() return self.getDestinationIdList()
......
...@@ -76,4 +76,4 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject, ...@@ -76,4 +76,4 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
PropertySheet.Transition, PropertySheet.Transition,
PropertySheet.Guard, PropertySheet.Guard,
PropertySheet.ActionInformation, 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