make simplePublishing a function that returns a utility
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2525 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
9f7afd166f
commit
1011f4b2eb
2 changed files with 6 additions and 7 deletions
|
@ -37,7 +37,7 @@ More complex states definitions
|
||||||
We'll use a predefined simple publishing workflow that.
|
We'll use a predefined simple publishing workflow that.
|
||||||
|
|
||||||
>>> from cybertools.stateful.publishing import simplePublishing
|
>>> from cybertools.stateful.publishing import simplePublishing
|
||||||
>>> registerStatesDefinition(simplePublishing)
|
>>> registerStatesDefinition(simplePublishing())
|
||||||
|
|
||||||
>>> demo = Demo()
|
>>> demo = Demo()
|
||||||
>>> demo.statesDefinition = 'publishing'
|
>>> demo.statesDefinition = 'publishing'
|
||||||
|
|
|
@ -22,18 +22,17 @@ Definition of a simple publishing workflow.
|
||||||
$Id$
|
$Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.interface import implements
|
from zope.interface import implementer
|
||||||
|
|
||||||
from cybertools.stateful.definition import registerStatesDefinition
|
from cybertools.stateful.definition import registerStatesDefinition
|
||||||
from cybertools.stateful.definition import StatesDefinition
|
from cybertools.stateful.definition import StatesDefinition
|
||||||
from cybertools.stateful.definition import State, Transition
|
from cybertools.stateful.definition import State, Transition
|
||||||
|
from cybertools.stateful.interfaces import IStatesDefinition
|
||||||
|
|
||||||
|
|
||||||
def simplePublishingFactory():
|
@implementer(IStatesDefinition)
|
||||||
return simplePublishing
|
def simplePublishing():
|
||||||
|
return StatesDefinition('publishing',
|
||||||
|
|
||||||
simplePublishing = StatesDefinition('publishing',
|
|
||||||
State('private', 'private', ('show',)),
|
State('private', 'private', ('show',)),
|
||||||
State('draft', 'draft', ('publish', 'hide',)),
|
State('draft', 'draft', ('publish', 'hide',)),
|
||||||
State('published', 'published', ('retract',)),
|
State('published', 'published', ('retract',)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue