On Fri, Jun 3, 2011 at 8:30 AM, Amit Sethi <amit.pureene...@gmail.com> wrote: >> functionality to your models. (For "row-level" functionality -- i.e., >> functions that act on a single instance of a model object -- use Model >> methods, not custom Manager methods.) >> > > But what is the benefit of model methods compared to adding an extra > field and getting almost the same thing done >
Maybe the result value depends on some parameters, If you use the DB field approach, and you want to keep up to date these values, you need to execute some expensive "regenerator" method each time that one of these parameters change, with Managers you don't need to do anything. If you use DB approach you need to populate these extra fields every time that a new object is saved, and maybe never uses it. if in the future you want to change the logic of your app and then you don't want this value anymore, you may have a problem if it is a db field.. -- Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.