Re:Django Styleguide
by traverseda on Thursday January 12, 2023 @08:57AM
(#34353504)
Right... so you're talking about mapping an object from your database to a pydantic object.
So you want an ORM, but you want it without a save method? Or presumably with a save method that can only be called under specific circumstances?
where Order is a pydantic model, not a fat django model. Other modules shouldn't know about my internal database. All other modules should use functions from this selector.py, they aren't allowed to use the OrderModel themselves directly, only the pydantic class. Because otherwise you end up with spaghetti.