migration/postcreate.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 16 Jan 2013 17:40:11 +0100
changeset 1421 00b78e701b79
parent 1007 0f8e2403d4d4
child 891 c6b69f595dd0
permissions -rw-r--r--
restore and unittest apycot.recipe.full

# postcreate script. You could setup a workflow here for example

wf = add_workflow(u'Test configuration workflow', 'TestConfig')
activated = wf.add_state(_('activated'), initial=True)
deactivated = wf.add_state(_('deactivated'))
wf.add_transition(_('deactivate'), activated, deactivated,
                  requiredgroups=('managers',))
wf.add_transition(_('activate'), deactivated, activated,
                  requiredgroups=('managers',))

# workflows don't consider schema inheritance, so we need to set it explicitly
rql('SET WF workflow_of TE, TE default_workflow WF WHERE WF workflow_of P, P name "Plan", TE name "TestExecution"')
commit()

from cubes.apycot import recipes
recipes.create_quick_recipe(session)
recipes.create_full_recipe(session)

if not config['pyro-server']:
    config.global_set_option('pyro-server', True)
    config.save()