business-logic-layer

Separation of business logic and data access in django

馋奶兔 提交于 2019-11-26 02:59:17
问题 I am writing a project in Django and I see that 80% of the code is in the file models.py . This code is confusing and, after a certain time, I cease to understand what is really happening. Here is what bothers me: I find it ugly that my model level (which was supposed to be responsible only for the work with data from a database) is also sending email, walking on API to other services, etc. Also, I find it unacceptable to place business logic in the view, because this way it becomes difficult