Replies: 3 comments 1 reply
-
note: adding
to my models is not really an option, because that will make the code also start validating objects as soon as they are created, not allowing different attributes to be populated in phases (which is something I suspect a lot of people do frequently) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Is your issue about the fact that in Pydantic v2, the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Any updates or thoughts on this one? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
The code above prints
if executed with pydantic v1 in the mix (1)*.
But it prints
With pydantic v2 in the mix (2)*.
This behaviour essentially breaks a fastapi application I am migrating to pedantic v2, because I assume, for example, that date attributes within objects passed in the body of post methods are already converted (originally passed as strings).
I couldn't find any recommendation related to this. I realize I could set table=False on the SQLModel object, but if I do that other behaviours change, related to validations for example.
Am I missing something?
(1) pyproject dependencies
(2) pyproject deps
Operating System
Linux
Operating System Details
No response
SQLModel Version
0.0.16
Python Version
3.10
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions