MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / IntEnumField

Function IntEnumField

tortoise/fields/data.py:919–941  ·  view source on GitHub ↗

Enum Field A field representing an integer enumeration. The description of the field is set automatically if not specified to a multiline list of "name: value" pairs. **Note**: Valid int value of ``enum_type`` is acceptable. ``enum_type``: The enum class ``de

(
    enum_type: type[IntEnumType],
    description: str | None = None,
    **kwargs: Any,
)

Source from the content-addressed store, hash-verified

917
918
919def IntEnumField(
920 enum_type: type[IntEnumType],
921 description: str | None = None,
922 **kwargs: Any,
923) -> IntEnumType:
924 """
925 Enum Field
926
927 A field representing an integer enumeration.
928
929 The description of the field is set automatically if not specified to a multiline list of
930 "name: value" pairs.
931
932 **Note**: Valid int value of ``enum_type`` is acceptable.
933
934 ``enum_type``:
935 The enum class
936 ``description``:
937 The description of the field. It is set automatically if not specified to a multiline list
938 of "name: value" pairs.
939
940 """
941 return IntEnumFieldInstance(enum_type, description, **kwargs) # type: ignore
942
943
944class CharEnumFieldInstance(CharField):

Callers 1

TypeTestModelClass · 0.90

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…