-
First Check
Commit to Help
Example CodeDescriptionCreating a model containing a discriminated union, as shown in the working example in the last comment in #356, raises the exception below. Operating SystemLinux Operating System DetailsNo response SQLModel Version0.0.19 Python Version3.10.12 Additional ContextPydantic version: 2.8.2 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This question was based on a misunderstanding of how SQLModel works. There is no way for SQLModel to automatically "collapse" nested models into a top-level table model. |
Beta Was this translation helpful? Give feedback.
This question was based on a misunderstanding of how SQLModel works. There is no way for SQLModel to automatically "collapse" nested models into a top-level table model.
And, as far as I understand, discriminated unions are only available for the Pydantic-based (i.e. non-ORM) part of SQLModel.