4 ms·
It's such a game changer... I always had the thought before in the back of my mind, "Why do I need to create two versions of every data model that basically spe
by eigenvalue 2y ago
It's such a game changer... I always had the thought before in the back of my mind, "Why do I need to create two versions of every data model that basically specify the same information (field name and type)?" And it turns out, you don't have to do that, you can use the same model for both the ORM and the response validation schema.
- asplake 2y agoRight! And the forms too? Got to say though, even if it doesn't do the html generation that WTForms does, it seems the better split.
- eigenvalue 2y agoNo it doesn't do any forms stuff, but you can easily get the forms using your preferred UI framework from the data model definitions themselves using an LLM.
- binary_slinger 2y agoSeparation of concerns. Input data from web is not always going to match schema of DB.
- sassbadger 2y agoI argued exactly this fact with a talented junior dev in our team. He still implemented his solution with SQLModel but started seeing the difficulties half a year into the project once the business requirements became more apparent and the API schema and data model started diverging.