class Action(XIntegerChoices):
""" 动作 枚举类 """
CREATE = 0, "创建"
DELETE = 1, "删除"
UPDATE = 2, "修改"
RETRIEVE = 3, "查看"
LIKE = 4, "点赞"
FOLLOW = 5, "关注"
COLLECT = 6, "收藏"
REGISTER = 7, "注册"
LOGIN = 8, "登录"
SEND = 9, "发送"
CANCEL = 10, "取消"
方式 2:
class Action(XIntegerChoices):
""" 动作 枚举类 """
CREATE = 0, "创建" # noqa
DELETE = 1, "删除" # noqa
UPDATE = 2, "修改" # noqa
RETRIEVE = 3, "查看" # noqa
LIKE = 4, "点赞" # noqa
FOLLOW = 5, "关注" # noqa
COLLECT = 6, "收藏" # noqa
REGISTER = 7, "注册" # noqa
LOGIN = 8, "登录" # noqa
SEND = 9, "发送" # noqa
CANCEL = 10, "取消" # noqa