Commit 638caa0a authored by wenjie.zheng's avatar wenjie.zheng

Variable.py: add setProperties, which is required in creating preconfiguredWorkflow.

parent c17da2c1
......@@ -99,3 +99,26 @@ class Variable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
if self.info_guard is not None:
res = self.info_guard.getSummary()
return res
  • Please remove this method. It's mostly a duplicate of the function edit.

    You can do ::

    variable.edit(description="foo", update_always=1)

    directly in Workflow_init

Please register or sign in to reply
# initial pre-configured workflow's variables
def setProperties(self, description,
default_value='', default_expr='',
for_catalog=0, for_status=0,
update_always=0,
props=None, REQUEST=None):
self.setDescription(str(description))
self.setInitialValue(str(default_value))
if default_expr:
self.setDefaultExpr(default_expr)
else:
self.default_expr = None
g = Guard()
if g.changeFromProperties(props or REQUEST):
self.info_guard = g
else:
self.info_guard = None
self.setForCatalog(bool(for_catalog))
self.setForStatus(bool(for_status))
self.setAutomaticUpdate(bool(update_always))
if REQUEST is not None:
return self.manage_properties(REQUEST, 'Properties changed.')
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