Commit e4f6b4f2 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

define getActionType() category accessor explicitly for better performance.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29621 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 738ecd2d
......@@ -165,3 +165,12 @@ class ActionInformation(XMLObject):
self.getActionText(),
self.getConditionText()]
return ' '.join(filter(None, search_source_list))
security.declareProtected(AccessContentsInformation, 'getActionType')
def getActionType(self):
# Since we should have only one category that starts with
# 'action_type/' here, we call self.categories[0][12:] (12 is the
# length of 'action_type/'), instead of self.getActionType() for
# better performance.
categories = getattr(self, 'categories', [])
return len(categories) and categories[0][12:] or None
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