Sunday, September 7, 2014

WHERE TO PLACE BUSINESS LOGIC IN DJANGOS' MTV

Hi All,

I have been to post like this https://groups.google.com/forum/#!topic/django-users/Ykppb4uELJ4 and other places and i'm even more confused than when i started.

Where should the business logic be placed in django, and what should go where in the following suggestions below ?

i'm aware of the following suggestions of placing the business logic:
  1.  in the model.py module as custom methods to models to be used in the instances of the model, this i have seen that using the http request and response is a security issue.also placing this business logic here makes this module extreme big.
  2.  custom managers the manager affects the entire database table of the specified model,
  3.  separate module to hold the business logic e.g service.py,

What i have seen in complete unity from the posts is that the business logic should not be in the view.py module, as of my understanding its supposed to handle http requests and response and delegating templates to use.also it becomes hard to do unit testing.

Regards,
Eddilbert Macharia.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/77e1a498-8d5f-4f75-bd15-03815b83d51d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment