How we can use separate endpoints for creating and updating objects in FastAPI #253
Unanswered
mojixcoder
asked this question in
Q&A
Replies: 2 comments
-
Are you using FastAPI? The docs have an example of how to work with FastAPI and have an example for creating instances and one for updating instances. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The AIOEngine.save and AIOEngine.save_all methods are actually behaving as upsert operations. In other words, if the instance already exists it will be updated. Otherwise, the related document will be created in the database. |
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
-
I want to be able to update and create instances with two endpoints.
does
odmantic
has any built-in ways to do it?I mean i want to not to let the client to give me the id of object for creating instances.
and for updating instances client must give me an id.
is it possible via
odmantic
models? or i should write newpydantic
models to do this?Beta Was this translation helpful? Give feedback.
All reactions