server/test/data/migration/postcreate.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 15 Dec 2009 12:24:38 +0100
branchstable
changeset 4121 09622a18501c
parent 3363 d3736311d0c4
child 4191 01638461d4b0
child 4212 ab6573088b4a
permissions -rw-r--r--
backout a75a6e770717, unmeetable condition and introduce a bug with boolean values
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
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     4
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
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