add 'archived' and 'removed' states to simple publishing
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2542 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
99cfd4a65b
commit
4ead71499e
2 changed files with 10 additions and 3 deletions
|
@ -44,6 +44,9 @@ We'll use a predefined simple publishing workflow that.
|
|||
>>> demo.getState()
|
||||
'draft'
|
||||
|
||||
>>> [t.title for t in demo.getAvailableTransitions()]
|
||||
['publish', 'hide', 'archive', 'remove']
|
||||
|
||||
If we try to execute a transition that is not an outgoing transition
|
||||
of the current state we get an error.
|
||||
|
||||
|
|
|
@ -33,11 +33,15 @@ from cybertools.stateful.interfaces import IStatesDefinition
|
|||
@implementer(IStatesDefinition)
|
||||
def simplePublishing():
|
||||
return StatesDefinition('publishing',
|
||||
State('private', 'private', ('show',)),
|
||||
State('draft', 'draft', ('publish', 'hide',)),
|
||||
State('published', 'published', ('retract',)),
|
||||
State('private', 'private', ('show', 'archive', 'remove')),
|
||||
State('draft', 'draft', ('publish', 'hide', 'archive', 'remove')),
|
||||
State('published', 'published', ('retract', 'archive')),
|
||||
State('archived', 'archived', ('show', 'remove')),
|
||||
State('removed', 'removed', ('show',)),
|
||||
Transition('show', 'show', 'draft'),
|
||||
Transition('hide', 'hide', 'private'),
|
||||
Transition('publish', 'publish', 'published'),
|
||||
Transition('retract', 'retract', 'draft'),
|
||||
Transition('archive', 'archive', 'archived'),
|
||||
Transition('remove', 'remove', 'removed'),
|
||||
initialState='draft')
|
||||
|
|
Loading…
Add table
Reference in a new issue