Commit e39839df authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix generation of reindexing setters


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43351 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1577c89e
...@@ -117,19 +117,6 @@ class CategoryProperty(XMLObject): ...@@ -117,19 +117,6 @@ class CategoryProperty(XMLObject):
'get%sTranslatedLogicalPath': Value.DefaultTranslatedLogicalPathGetter, 'get%sTranslatedLogicalPath': Value.DefaultTranslatedLogicalPathGetter,
} }
setter_definition_dict = { setter_definition_dict = {
# public 'reindexers'
'set%s': Alias.Reindex,
'set%sList': Alias.Reindex,
'setDefault%s': Alias.Reindex,
'set%sSet': Alias.Reindex,
'set%sValue': Alias.Reindex,
'set%sValueList': Alias.Reindex,
'set%sValueSet': Alias.Reindex,
'setDefault%sValue': Alias.Reindex,
'set%sUid': Alias.Reindex,
'set%sUidList': Alias.Reindex,
'set%sUidSet': Alias.Reindex,
'setDefault%sUid': Alias.Reindex,
# setters # setters
'_set%s': Category.Setter, '_set%s': Category.Setter,
'_categorySet%s': Category.Setter, '_categorySet%s': Category.Setter,
...@@ -232,6 +219,11 @@ class CategoryProperty(XMLObject): ...@@ -232,6 +219,11 @@ class CategoryProperty(XMLObject):
accessor = accessor_class(accessor_name, category_id) accessor = accessor_class(accessor_name, category_id)
accessor_holder.registerAccessor(accessor, write_permission) accessor_holder.registerAccessor(accessor, write_permission)
# TODO: merge with StandardProperty
if accessor_name.startswith('_set'):
accessor = Alias.Reindex(accessor_name[1:], accessor_name)
accessor_holder.registerAccessor(accessor, write_permission)
accessor_holder._categories.append(category_id) accessor_holder._categories.append(category_id)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
......
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