Re:Maintain a Clean Architecture in Python with Dependency R...
by rekahrv on Thursday December 15, 2022 @01:12PM
(#34003376)
I've used multiple names for similar packages incl. `models` and `schemas`. :-)
Yes, for this example, I picked `models` to follow Pydantic's terminology.
IMO, the FastAPI approach you described makes a lot of sense:
The "schema" stored in the db and the "schema" returned by the API aren't the same, but they are quite similar. They have many common properties => They can often have a common base class.
IMO, the FastAPI approach you described makes a lot of sense: The "schema" stored in the db and the "schema" returned by the API aren't the same, but they are quite similar. They have many common properties => They can often have a common base class.