Add support for workflow transition triggers.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@ class Event(object):
|
||||
|
||||
@classmethod
|
||||
def all(cls):
|
||||
return cls._registry.values()
|
||||
return Event.sort(event_type_list=cls._registry.values())
|
||||
|
||||
@classmethod
|
||||
def get(cls, name):
|
||||
@@ -30,6 +30,17 @@ class Event(object):
|
||||
except KeyError as exception:
|
||||
return force_text(exception)
|
||||
|
||||
@classmethod
|
||||
def refresh(cls):
|
||||
for event_type in cls.all():
|
||||
event_type.get_type()
|
||||
|
||||
@staticmethod
|
||||
def sort(event_type_list):
|
||||
return sorted(
|
||||
event_type_list, key=lambda x: x.label
|
||||
)
|
||||
|
||||
def __init__(self, name, label):
|
||||
self.name = name
|
||||
self.label = label
|
||||
|
||||
Reference in New Issue
Block a user