Commit a7301a29 authored by Jérome Perrin's avatar Jérome Perrin

improve method names generation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3610 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc654109
...@@ -118,22 +118,18 @@ class PreferenceTool(BaseTool): ...@@ -118,22 +118,18 @@ class PreferenceTool(BaseTool):
property_sheet = getattr(__import__(property_sheet), property_sheet) property_sheet = getattr(__import__(property_sheet), property_sheet)
# then generate common method names # then generate common method names
# (XXX should be available from ERP5Type API ?) # (XXX should be available from ERP5Type API ?)
for attribute in property_sheet._properties : for attribute in [ prop['id'] for prop in property_sheet._properties ]\
attr_name = attribute['id'] + getattr(property_sheet, '_categories', []) :
attr_list += [ attr_name, attr_list += [ attribute,
'get%s' % convertToUpperCase(attr_name), 'get%s' % convertToUpperCase(attribute),
'get%sList' % convertToUpperCase(attr_name), ] 'get%sId' % convertToUpperCase(attribute),
for cat in getattr(property_sheet, '_categories', []) : 'get%sTitle' % convertToUpperCase(attribute),
attr_list += [ 'get%s' % convertToUpperCase(cat), 'get%sValue' % convertToUpperCase(attribute),
'get%sId' % convertToUpperCase(cat), 'get%sValueList' % convertToUpperCase(attribute),
'get%sTitle' % convertToUpperCase(cat), 'get%sItemList' % convertToUpperCase(attribute),
'get%sValue' % convertToUpperCase(cat), 'get%sIdList' % convertToUpperCase(attribute),
'get%sValueList' % convertToUpperCase(cat), 'get%sTitleList' % convertToUpperCase(attribute),
'get%sItemList' % convertToUpperCase(cat), 'get%sList' % convertToUpperCase(attribute), ]
'get%sIdList' % convertToUpperCase(cat),
'get%sTitleList' % convertToUpperCase(cat),
'get%sList' % convertToUpperCase(cat),
]
LOG('PreferenceTool.getValidPreferenceNames', BLATHER, attr_list) LOG('PreferenceTool.getValidPreferenceNames', BLATHER, attr_list)
return attr_list return attr_list
_getValidPreferenceNames = CachingMethod( _getValidPreferenceNames = CachingMethod(
......
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