Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
fed52d317ba7
Commit
f8b19992
authored
Aug 25, 2009
by
Sylvain Thénault
Browse files
[wf] new .workflow property on states and transitions
--HG-- branch : 3.5
parent
3dfe497e5afa
Changes
1
Show whitespace changes
Inline
Side-by-side
entities/wfobjs.py
View file @
fed52d31
...
...
@@ -128,6 +128,10 @@ class BaseTransition(AnyEntity):
raise
Exception
(
'should not be instantiated'
)
super
(
BaseTransition
,
self
).
__init__
(
*
args
,
**
kwargs
)
@
property
def
workflow
(
self
):
return
self
.
transition_of
[
0
]
def
may_be_fired
(
self
,
eid
):
"""return true if the logged user may fire this transition
...
...
@@ -218,6 +222,10 @@ class State(AnyEntity):
fetch_attrs
,
fetch_order
=
fetch_config
([
'name'
])
rest_attr
=
'eid'
@
property
def
workflow
(
self
):
return
self
.
state_of
[
0
]
def
after_deletion_path
(
self
):
"""return (path, parameters) which should be used as redirect
information when this entity is being deleted
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment