migration/postcreate.py
author David Douard <david.douard@logilab.fr>
Thu, 13 Nov 2014 15:15:38 +0100
changeset 1757 224cd20b7284
parent 1740 f3137466457a
child 1622 84913fb4d2e7
permissions -rw-r--r--
[test] improve unittest_apycot

# 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()


print " RECIPES ".center(60, "=")
from cubes.apycot import recipes
recipes.create_recipes(session)
commit()