I'm not sure if there's an official stance on that, but I believe that since Django is a "MVT" framework, that kind of logic does not seem to be appropiate neither for templates nor views, so models seem like the logical choice.
That way you can also make sure that the side-effect that you want to be called (cache update when changing a model, for example) are always executed when calling the model's method. On Fri, Feb 20, 2015 at 5:23 AM, Gergely Polonkai <gerg...@polonkai.eu> wrote: > Hello, > > I’m currently implementing a finite state machine in my application using > Django FSM[1]. In the Usage section of the README the author said that > “This function may contain side-effects, like updating caches, notifying > users, etc.” > > Opposing this statement, the Symfony PHP framework’s authors say that > models should never have such side effects. > > Thus, I was wondering what is the case with Django in this topic. Should I > really do such things, like notifying users, in the model’s code? > > Best, > Gergely > > > [1] https://github.com/kmmbvnr/django-fsm > > -- > 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 http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/69272d49-de97-40a0-9682-430f28f38663%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/69272d49-de97-40a0-9682-430f28f38663%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei0q2-i2JQpe9zTS90PxCt%2BRY7%2BVRQLFRZPg21Muy581zA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.