|
|
|
|
|
by globular-toast
572 days ago
|
|
No, I want a web framework that is just a web framework. The web is just an entrypoint to an application, like a CLI or GUI. If you use something like Flask or Pyramid this is exactly what you get. They are roughly analogous to something like Qt. Something that sits at the edge of an application converting low-level user input into high-level commands and events etc. You could use Django like this, but you'd end up manually mapping between Django models and high-level domain models. But this mapping is exactly what an ORM like SQLAlchemy does! It seems crazy to do it yourself. So nobody does. They build fat models with all the business logic right next to application logic like foreign keys etc. Even if you did try to do something different developers would complain that it's no longer a "Django project". Have you ever seen any Django project do business logic completely independently of application logic? |
|
If you really prefer SQLAlchemy, there is nothing stopping you from using it over the Django ORM, I happen to prefer the Django ORM, but Django doesn't get jealous if you go out with a different ORM (it is a polyamorious web framework[1]).
Yes, I have seen Django applications do that. There are plenty of individuals out there advocating such a separation. I wouldn't worry about these "different developers' and their opinions.
[1] I was going to use a smiley face here, but then I recalled that a Python dev was de-flocked recently for using smiley emoji as it is offensive to some individuals, so insert whatever words or symbols you don't find offensive that indicate humor instead.