What is the purpose of parse_obj's second argument: "update"? #1461
First Check
Commit to Help
Example CodeSomeModel.parse_obj({"one": 2}, {"three": 4})DescriptionSQLModel's Could someone explain why it was added? What was the actual use case? I understand what it does, but I don't understand why it does it. Operating SystemLinux, Windows, macOS, Other Operating System DetailsNo response SQLModel Version0.0.8 Python Version3.11 Additional ContextNo response |
Answered by
DLukeNelson
Mar 4, 2024
Replies: 2 comments
|
I'm using it in from_orm when get some parameters to create a new object in an API call from a client, but then add more values to the DB type using some logic in my endpoint function. So am doing this: |
0 replies
0 replies
Answer selected by
YuriiMotov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://sqlmodel.tiangolo.com/tutorial/fastapi/update-extra-data/#create-a-model-object-with-extra-data