79264057

Date: 2024-12-09 06:47:42
Score: 0.5
Natty:
Report link

The correct answer, provided by the author of SQLModel is:

Use a model for data validation (table=False) and create a model for SQL by inheriting the data validation model adding table=True.

Then after validation, copy data from data validation model to SQL model.

Full answer here: https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1311987732

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: vpoulailleau