admin: add support for more transitions in workflow graphs (#1724)
This commit is contained in:
parent
fb54638215
commit
a94cc30625
|
@ -113,11 +113,18 @@ def graphviz(workflow, url_prefix='', select=None, svg=True,
|
|||
for status in workflow.possible_status:
|
||||
i = status.id
|
||||
for item in status.items:
|
||||
if getattr(item, 'status', None):
|
||||
next_id = item.status
|
||||
else:
|
||||
next_id = status.id
|
||||
print >>out, 'status%s -> status%s' % (i, next_id)
|
||||
next_status_ids = []
|
||||
for status_key in item.__dict__:
|
||||
if status_key == 'status' or \
|
||||
status_key.startswith('status_') or \
|
||||
status_key.endswith('_status'):
|
||||
next_id = getattr(item, status_key, None)
|
||||
if next_id:
|
||||
next_status_ids.append(next_id)
|
||||
if not next_status_ids:
|
||||
next_status_ids = [status.id]
|
||||
for next_id in next_status_ids:
|
||||
print >>out, 'status%s -> status%s' % (i, next_id)
|
||||
url = 'status/%s/items/%s/' % (i, item.id)
|
||||
if getattr(item, 'label', None):
|
||||
label = item.label
|
||||
|
|
Loading…
Reference in New Issue