Can one instantiate an Ormar model using the .construct() method? #317
Answered
by
collerek
franzwollang
asked this question in
Q&A
-
In Pydantic, one can use the .construct() method to instantiate a model while skipping validation. I tried it out with an Ormar model and it seemed to work, except there were some random exceptions when I tried to .save() it that gave me the impression that perhaps doing this broke some of Ormar's internals. Does Ormar work with the .construct() method? Or is there an Ormar equivalent? |
Beta Was this translation helpful? Give feedback.
Answered by
collerek
Aug 22, 2021
Replies: 1 comment 1 reply
-
In theory you probably can but that won't populate relations... Somehow skipped those method in pydantic 😅🤷 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
franzwollang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In theory you probably can but that won't populate relations...
Somehow skipped those method in pydantic 😅🤷
Skipping the validation can sure come in handy so can you please open an enhancement issue for this?