Enums are not autocompleted & gives error #1489
Answered
by
YuriiMotov
jd-solanki
asked this question in
Questions
First Check
Commit to Help
Example Codeclass EnumAccessStatus(Enum):
PENDING = "pending"
APPROVED = "approved"
REJECTED = "rejected"
REVOKED = "revoked"
class Temp(SQLModel):
py_type: EnumAccessStatus
access_status = Field(
sa_column=Column(
sqlAlchemyEnum(EnumAccessStatus)
)
)Description
Operating SystemLinux Operating System DetailsUbuntu 21.10 64-bit SQLModel Version0.0.6 Python Version3.10.2 Additional Context |
Answered by
YuriiMotov
Aug 12, 2025
Replies: 3 comments
|
As mentioned in python docs you have to inherit from both |
0 replies
This is because you didn't specify the type of this parameter.
access_status: EnumAccessStatus = Field(
sa_column=Column(
sqlAlchemyEnum(EnumAccessStatus)
)
) |
0 replies
Answer selected by
YuriiMotov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



This is because you didn't specify the type of this parameter.
sa_columnis only for SQLAlchemy. You still need to add type annotations for this field for Pydantic to be able to create the init method: