class CeleryTaskRunLogState(IntegerChoicesEnum): ACTIVE = Choice(1, _('Active')) SUCCEEDED = Choice(2, _('Succeeded')) FAILED = Choice(3, _('Failed')) RETRIED = Choice(4, _('Retried')) EXPIRED = Choice(5, _('Expired'))
class CeleryTaskLogState(ChoiceEnum): WAITING = Choice(1, _('Waiting')) ACTIVE = Choice(2, _('Active')) SUCCEEDED = Choice(3, _('Succeeded')) FAILED = Choice(4, _('Failed')) RETRIED = Choice(5, _('Retried'))
class RequestLogState(IntegerChoicesEnum): INCOMPLETE = Choice(0, _('Incomplete')) DEBUG = Choice(10, _('Debug')) INFO = Choice(20, _('Info')) WARNING = Choice(30, _('Warning')) ERROR = Choice(40, _('Error'))
class CeleryTaskInvocationLogState(IntegerChoicesEnum): WAITING = Choice(1, _('Waiting')) TRIGGERED = Choice(7, _('Triggered')) ACTIVE = Choice(2, _('Active')) SUCCEEDED = Choice(3, _('Succeeded')) FAILED = Choice(4, _('Failed')) EXPIRED = Choice(6, _('Expired')) TIMEOUT = Choice(8, _('Timeout')) IGNORED = Choice(9, _('Ignored')) DUPLICATE = Choice(10, _('Duplicate'))
class LoggedRequestStatus(ChoiceEnum): INCOMPLETE = Choice(0, _('Incomplete')) DEBUG = Choice(10, _('Debug')) INFO = Choice(20, _('Info')) WARNING = Choice(30, _('Warning')) ERROR = Choice(40, _('Error')) CRITICAL = Choice(50, _('Critical'))
class InputLoggedRequestType(ChoiceEnum): COMMON_REQUEST = Choice(1, _('Common request')) THROTTLED_REQUEST = Choice(2, _('Throttled request')) SUCCESSFUL_LOGIN_REQUEST = Choice(3, _('Successful login request')) UNSUCCESSFUL_LOGIN_REQUEST = Choice(4, _('Unsuccessful login request')) SUCCESSFUL_2FA_CODE_VERIFICATION_REQUEST = Choice(5, _('Successful two factor code verification request')) UNSUCCESSFUL_2FA_CODE_VERIFICATION_REQUEST = Choice(6, _('Unsuccessful two factor code verification request'))
class Color(ChoiceEnum): __order__ = 'RED GREEN BLUE' RED = Choice('r', 'Reddish') GREEN = 'g' BLUE = Choice('b', ugettext_lazy('bluë'))
class StateFlow(NumChoiceEnum): START = Choice(4, 'start', next={'PROCESSING'}) PROCESSING = Choice(5, 'processing', next={'END'}, initial=False) END = Choice(6, 'end', next=set(), initial=False)
class StateFlowAnyFirst(NumChoiceEnum): START = Choice(0, 'start', next={'PROCESSING'}) PROCESSING = Choice(1, 'processing', next={'END'}) END = Choice(2, 'end', next=set())
class IntegerAutoEnum(IntegerChoicesEnum): A = auto() B = auto(), 'b' C = Choice(auto(), 'c')
class LabeledEnum(ChoiceEnum): FOO = Choice('foo', 'Foo') BAR = Choice('bar', 'Bar') FOOBAR = Choice('foobar', 'Foo') # this is intentional. see test_nonunique_label
class IntegerEnum(NumChoiceEnum): A = Choice(0, 'foo') B = 1 C = 2
class CommandState(IntegerChoicesEnum): ACTIVE = Choice(1, _('Active')) SUCCEEDED = Choice(2, _('Succeeded')) FAILED = Choice(3, _('Failed'))
class TextAutoEnum(TextChoicesEnum): A = auto() B = auto(), 'b' C = Choice(auto(), 'c')
class DuplicateEnum(TextChoicesEnum): A = Choice(1, 'a') B = Choice(1, 'b')
class SubIntegerEnum(NumChoiceEnum): C = Choice(0, 'C', parents=(IntegerEnum.A, IntegerEnum.B)) D = Choice(1, 'D', parents=(IntegerEnum.B,))
class LegalReasonState(ChoiceEnum): ACTIVE = Choice(1, _('Active')) EXPIRED = Choice(2, _('Expired')) DEACTIVATED = Choice(3, _('Deactivated'))
class IntegerEnum(IntegerChoicesEnum): A = Choice(0, 'foo') B = 1 C = 2