Skip to content

Instantly share code, notes, and snippets.

@duTianze
duTianze / gist:ec16ab6658e293ab2b1db3b02876763a
Last active December 8, 2023 06:58
python enum with label
from enum import IntEnum
from pydantic import BaseModel
class DropdownCode(BaseModel):
display_code: Optional[str] = Field(None, title="表示コード")
display_name: Optional[str] = Field(None, title="表示名")
class LabelEnum(IntEnum):