✨ Add support for pydantic date types#1384
Conversation
|
@dereisele, thanks for your efforts! I think this should be covered by tests. Would you like to work on this? |
Thank you for providing this library in the first place. Sure, can you show me a similar test? |
As I see it, we need to create a model with different field types that are affected by this PR and test that generate |
| return Time | ||
| if IS_PYDANTIC_V2: | ||
| if issubclass(type_, (FutureDate, PastDate)): | ||
| return DateTime |
There was a problem hiding this comment.
Not sure about this. Why not Date?
| from pydantic import ( | ||
| BaseModel, | ||
| EmailStr, | ||
| ) |
There was a problem hiding this comment.
I would put unrelated reformatting in a separate PR.
There was a problem hiding this comment.
I think we don't need this particular reformatting at all)
|
is this still a work in progress? i have quite some issues with pylance in sqlmodel (asyncsession, tablename, sometimes with fields). im a noob so could be my fault. |
|
As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR. |
Add support for pydantic date types
This PR adds mappings for the Pydantic Datetime Types. https://docs.pydantic.dev/latest/api/types/#pydantic.types.AwareDatetime
It improves #539.
Please let me know how I add unittests for this.