> > > Custom logic like calculations can be integrated in to any view or > viewset. Often times the logic is broken out in to separate standalone > functions and called by some simple overrides on the view[set]. >
I forgot to mention, you may want to integrate that business logic directly in to your models if the logic will be accessed from more than one view, rather than trying to crowbar in the same operation to multiple views. Model managers work well for logic that is applied across groups of model instances (ie filtering specific instances out, or performing calculations based on a set of criteria against a model type), and methods defined directly on the model should work specifically with that model instance without the need for a crazy view. Typically very little business logic is integrated in to the views (which is why so much work has gone in to making them generic, they are often boiler-plate with minute differences such as the template to render or the class of model to query). -James -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXZ0Et2pFWQUUkC-7eLqQTGi-tmjH7iSAiq28UCNOjGrw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.