Commit ece9eb52 authored by Sebastien Robin's avatar Sebastien Robin

we should be able to specify a script to udpateCellRange


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2858 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cf86071c
...@@ -313,7 +313,7 @@ class XMLMatrix(Folder): ...@@ -313,7 +313,7 @@ class XMLMatrix(Folder):
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'updateCellRange') security.declareProtected(Permissions.ModifyPortalContent, 'updateCellRange')
def updateCellRange(self, base_id): def updateCellRange(self, base_id,script_id=None):
""" """
The asCellRange script if PT dependent The asCellRange script if PT dependent
whoch is not the case with this kind of code whoch is not the case with this kind of code
...@@ -327,6 +327,9 @@ class XMLMatrix(Folder): ...@@ -327,6 +327,9 @@ class XMLMatrix(Folder):
asCellRange scripts should be unified if possible asCellRange scripts should be unified if possible
""" """
script_name_end = '_asCellRange' script_name_end = '_asCellRange'
if script_id is not None:
script = getattr(self, script_id)
else:
for script_name_begin in [self.getPortalType(), self.getMetaType(), self.__class__.__name__]: for script_name_begin in [self.getPortalType(), self.getMetaType(), self.__class__.__name__]:
script_name = join( [ replace(script_name_begin, ' ','') , script_name_end ], '') script_name = join( [ replace(script_name_begin, ' ','') , script_name_end ], '')
if hasattr(self, script_name): if hasattr(self, script_name):
......
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