How we can use separate endpoints for creating and updating objects in FastAPI #253
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.
-
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.
-
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