Commit d9b1c21c authored by wenjie.zheng's avatar wenjie.zheng

Worklist.py: deploy property accessors as many as possible.

parent aca169cb
...@@ -109,7 +109,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject): ...@@ -109,7 +109,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
res = [] res = []
res.append(self.getParentValue().getStateVariable()) res.append(self.getParentValue().getStateVariable())
for vdef in self.getParentValue().contentValues(portal_type="Variable"): for vdef in self.getParentValue().contentValues(portal_type="Variable"):
if vdef.for_catalog: if vdef.getForCatalog():
res.append(vdef.getId()) res.append(vdef.getId())
for vdef in self.objectValues(): for vdef in self.objectValues():
res.append(vdef.getId()) res.append(vdef.getId())
...@@ -140,16 +140,16 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject): ...@@ -140,16 +140,16 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
variable_id = variable_value.getId() variable_id = variable_value.getId()
workflow_variable_id_list.append(variable_id) workflow_variable_id_list.append(variable_id)
worklist_variable_value = self._getOb(variable_id, None) worklist_variable_value = self._getOb(variable_id, None)
if worklist_variable_value is None and variable_value.for_catalog == 1 and variable_id not in default_variable_id_list: if worklist_variable_value is None and variable_value.getForCatalog() == 1 and variable_id not in default_variable_id_list:
variable_value_ref = variable_value.getReference() variable_value_ref = variable_value.getReference()
worklist_variable_value = self.newContent(portal_type='Worklist Variable') worklist_variable_value = self.newContent(portal_type='Worklist Variable')
worklist_variable_value.setReference(variable_value_ref) worklist_variable_value.setReference(variable_value_ref)
worklist_variable_value.setDefaultExpr(variable_value.getDefaultExpr()) worklist_variable_value.setDefaultExpr(variable_value.getDefaultExpr())
worklist_variable_value.setInitialValue(variable_value.getInitialValue()) worklist_variable_value.setInitialValue(variable_value.getInitialValue())
res.append(worklist_variable_value) res.append(worklist_variable_value)
if worklist_variable_value and worklist_variable_value not in res and variable_value.for_catalog == 1: if worklist_variable_value and worklist_variable_value not in res and variable_value.getForCatalog() == 1:
res.append(worklist_variable_value) res.append(worklist_variable_value)
if worklist_variable_value in res and variable_value.for_catalog == 0: if worklist_variable_value in res and variable_value.getForCatalog() == 0:
self._delObject(variable_id) self._delObject(variable_id)
res.remove(worklist_variable_value) res.remove(worklist_variable_value)
......
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