コード例 #1
0
ファイル: enums.py プロジェクト: druids/django-security
class CeleryTaskRunLogState(IntegerChoicesEnum):

    ACTIVE = Choice(1, _('Active'))
    SUCCEEDED = Choice(2, _('Succeeded'))
    FAILED = Choice(3, _('Failed'))
    RETRIED = Choice(4, _('Retried'))
    EXPIRED = Choice(5, _('Expired'))
コード例 #2
0
ファイル: enums.py プロジェクト: radimsuckr/django-security
class CeleryTaskLogState(ChoiceEnum):

    WAITING = Choice(1, _('Waiting'))
    ACTIVE = Choice(2, _('Active'))
    SUCCEEDED = Choice(3, _('Succeeded'))
    FAILED = Choice(4, _('Failed'))
    RETRIED = Choice(5, _('Retried'))
コード例 #3
0
ファイル: enums.py プロジェクト: druids/django-security
class RequestLogState(IntegerChoicesEnum):

    INCOMPLETE = Choice(0, _('Incomplete'))
    DEBUG = Choice(10, _('Debug'))
    INFO = Choice(20, _('Info'))
    WARNING = Choice(30, _('Warning'))
    ERROR = Choice(40, _('Error'))
コード例 #4
0
ファイル: enums.py プロジェクト: druids/django-security
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'))
コード例 #5
0
ファイル: enums.py プロジェクト: radimsuckr/django-security
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'))
コード例 #6
0
ファイル: enums.py プロジェクト: radimsuckr/django-security
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'))
コード例 #7
0
class Color(ChoiceEnum):
    __order__ = 'RED GREEN BLUE'

    RED = Choice('r', 'Reddish')
    GREEN = 'g'
    BLUE = Choice('b', ugettext_lazy('bluë'))
コード例 #8
0
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)
コード例 #9
0
class StateFlowAnyFirst(NumChoiceEnum):
    START = Choice(0, 'start', next={'PROCESSING'})
    PROCESSING = Choice(1, 'processing', next={'END'})
    END = Choice(2, 'end', next=set())
コード例 #10
0
class IntegerAutoEnum(IntegerChoicesEnum):
    A = auto()
    B = auto(), 'b'
    C = Choice(auto(), 'c')
コード例 #11
0
class LabeledEnum(ChoiceEnum):
    FOO = Choice('foo', 'Foo')
    BAR = Choice('bar', 'Bar')
    FOOBAR = Choice('foobar', 'Foo')  # this is intentional. see test_nonunique_label
コード例 #12
0
class IntegerEnum(NumChoiceEnum):
    A = Choice(0, 'foo')
    B = 1
    C = 2
コード例 #13
0
ファイル: enums.py プロジェクト: druids/django-security
class CommandState(IntegerChoicesEnum):

    ACTIVE = Choice(1, _('Active'))
    SUCCEEDED = Choice(2, _('Succeeded'))
    FAILED = Choice(3, _('Failed'))
コード例 #14
0
class TextAutoEnum(TextChoicesEnum):
    A = auto()
    B = auto(), 'b'
    C = Choice(auto(), 'c')
コード例 #15
0
 class DuplicateEnum(TextChoicesEnum):
     A = Choice(1, 'a')
     B = Choice(1, 'b')
コード例 #16
0
class SubIntegerEnum(NumChoiceEnum):
    C = Choice(0, 'C', parents=(IntegerEnum.A, IntegerEnum.B))
    D = Choice(1, 'D', parents=(IntegerEnum.B,))
コード例 #17
0
class LegalReasonState(ChoiceEnum):

    ACTIVE = Choice(1, _('Active'))
    EXPIRED = Choice(2, _('Expired'))
    DEACTIVATED = Choice(3, _('Deactivated'))
コード例 #18
0
class IntegerEnum(IntegerChoicesEnum):
    A = Choice(0, 'foo')
    B = 1
    C = 2