server/test/data/migration/postcreate.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 08 Feb 2010 09:57:25 +0100
branchstable
changeset 4488 e8e7f6a0e7b6
parent 4212 ab6573088b4a
child 4252 6c4f109c2b03
permissions -rw-r--r--
errors on postcommit should never occurs, log it as critical
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1977
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     1
"""cubicweb post creation script, set note's workflow
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     2
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     3
:organization: Logilab
4212
ab6573088b4a update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 3363
diff changeset
     4
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
1977
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     5
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     6
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     7
"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
3363
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
     9
wf = add_workflow(u'note workflow', 'Note')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    10
todo = wf.add_state(u'todo', initial=True)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    11
done = wf.add_state(u'done')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    12
wf.add_transition(u'redoit', done, todo)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    13
wf.add_transition(u'markasdone', todo, done)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    14
checkpoint()
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    15
3363
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    16
wf = add_workflow(u'affaire workflow', 'Affaire')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    17
pitetre = wf.add_state(u'pitetre', initial=True)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    18
encours = wf.add_state(u'en cours')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    19
finie = wf.add_state(u'finie')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    20
bennon = wf.add_state(u'ben non')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    21
wf.add_transition(u'abort', pitetre, bennon)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    22
wf.add_transition(u'start', pitetre, encours)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    23
wf.add_transition(u'end', encours, finie)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    24
checkpoint()
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    25