Error with MySQL DateTime! str type expected (type=type_error.str) #98
-
I have created my model from pre-existing MySQL database everything working fine butt when I add DateTime: str gives error. str type expected (type=type_error.str) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
from pydantic import BaseModel class YourPydanticModel(BaseModel): Example usagedata = { pydantic_instance = YourPydanticModel(**data) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the patience with my reply! 😅 This would be a feature request. I deprecated this library a while ago in favor of SQLModel which would solve all the same use cases in a much better way, and I'm directing all the effort in that direction. SQLModel uses Pydantic models to define both data and table (SQL) models, so it's easier to do all these things. 🚀 |
Beta Was this translation helpful? Give feedback.
Thanks for the patience with my reply! 😅
This would be a feature request.
I deprecated this library a while ago in favor of SQLModel which would solve all the same use cases in a much better way, and I'm directing all the effort in that direction.
SQLModel uses Pydantic models to define both data and table (SQL) models, so it's easier to do all these things. 🚀