Reputation: 13172
I am writing a Django web app which provides a user interface to do numerical analysis calculations. I want to have a form which submits a set of data using POST. This is the point where I am getting stuck. Should I put all of the calculation calls in the models, or the views, after receiving the POST data?
Upvotes: 1
Views: 742
Reputation: 616
From the Django Docs
Business logic should go inside models. Views are to define the way data is presented to the user.
The “view” describes the data that gets presented to the user. It’s not necessarily how the data looks, but which data is presented. The view describes which data you see, not how you see it.
The view should be clean from business logic and should only be used to get the data to be displayed/presented on template or in other words let the view be used for view logic only.
Upvotes: 5