Skip to content
Discussion options

You must be logged in to vote

You shouldn't use table-model (with table=True) for validation. Create base class with common fields (excluding relationships) and inherit input validation model and table-model from that base class.

See: https://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/#multiple-models-with-inheritance

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andrewnathanco
Comment options

Answer selected by andrewnathanco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants