Skip to content

Commit 921c295

Browse files
author
KunxiSun
committed
doc: no class docstring like other s
1 parent bfcd346 commit 921c295

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

sqlmodel/sql/sqltypes.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,6 @@ def load_dialect_impl(self, dialect: Dialect) -> "types.TypeEngine[Any]":
2020

2121

2222
class IntEnum(types.TypeDecorator): # type: ignore
23-
"""TypeDecorator for Integer-enum conversion.
24-
25-
Automatically converts Python enum.IntEnum <-> database integers.
26-
27-
Args:
28-
enum_type (enum.IntEnum): Integer enum class (subclass of enum.IntEnum)
29-
30-
Example:
31-
>>> class HeroStatus(enum.IntEnum):
32-
... ACTIVE = 1
33-
... DISABLE = 2
34-
>>>>
35-
>>> from sqlmodel import IntEnum
36-
>>> class Hero(SQLModel):
37-
... hero_status: HeroStatus = Field(sa_type=sqlmodel.IntEnum(HeroStatus))
38-
>>> user.hero_status == Status.ACTIVE # Loads back as enum
39-
40-
Returns:
41-
Optional[enum.IntEnum]: Converted enum instance (None if database value is NULL)
42-
43-
Raises:
44-
TypeError: For invalid enum types
45-
"""
46-
4723
impl = types.Integer
4824

4925
def __init__(self, enum_type: Type[_TIntEnum], *args: Any, **kwargs: Any):

0 commit comments

Comments
 (0)