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

prevent infinite loop when accepting non existant method names


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3613 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 16b2b0c5
......@@ -36,6 +36,7 @@ from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.Accessor.TypeDefinition import list_types
from Products.ERP5Form import _dtmldir
class PreferenceTool(BaseTool):
......@@ -117,9 +118,15 @@ class PreferenceTool(BaseTool):
# import the property sheet
property_sheet = getattr(__import__(property_sheet), property_sheet)
# then generate common method names
# (XXX should be available from ERP5Type API ?)
for attribute in [ prop['id'] for prop in property_sheet._properties ]\
+ list(getattr(property_sheet, '_categories', [])) :
for prop in property_sheet._properties :
attribute = prop['id']
attr_list += [ attribute,
'get%s' % convertToUpperCase(attribute),
'get%sId' % convertToUpperCase(attribute),
'get%sTitle' % convertToUpperCase(attribute), ]
if prop['type'] in list_types :
attr_list += ['get%sList' % convertToUpperCase(attribute), ]
for attribute in list(getattr(property_sheet, '_categories', [])) :
attr_list += [ attribute,
'get%s' % convertToUpperCase(attribute),
'get%sId' % convertToUpperCase(attribute),
......
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