-
The required input from the user is a nested json,
Expected: sqlalachamy ORM will break this json and insert it to customers and subsciber tables . Issues: How i can define the Base class so it will not expect the id column
i face issue defining the class when i remove fields as "id" (which not exists in the expected json),
Second ,what am i doing wrong ? see: Models:
added the Pydantic models and route:
Getting error:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
is there anyone who find solution for nested objects? |
Beta Was this translation helpful? Give feedback.
-
I tried something, but its a bit manual
Does that help? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the patience with my reply! 😅 This would be a feature request. I deprecated this library a while ago in favor of SQLModel which would solve all the same use cases in a much better way, and I'm directing all the effort in that direction. SQLModel uses Pydantic models to define both data and table (SQL) models, so it's easier to do all these things. 🚀 |
Beta Was this translation helpful? Give feedback.
Thanks for the patience with my reply! 😅
This would be a feature request.
I deprecated this library a while ago in favor of SQLModel which would solve all the same use cases in a much better way, and I'm directing all the effort in that direction.
SQLModel uses Pydantic models to define both data and table (SQL) models, so it's easier to do all these things. 🚀