On Mon, 2008-04-28 at 10:43 +0200, Johannes Beigel wrote: > Am 28.04.2008 um 10:21 schrieb Malcolm Tredinnick: > > On Mon, 2008-04-28 at 00:28 -0700, ludvig.ericson wrote: > >> > >> suppose: > >> > >> class MyModel(models.Model): > >> def save(self): > >> if not self.id: > >> self.some_date = datetime.now() > >> super(MyModel, self).save() > >> > >> Tada, keyword argument invalid and not passed. > > > > Nonsense. That's why they have default values. If you don't pass > > anything the default is applied. > > I don't think that's what ludgiv.ericson meant. It fails when you > *pass* that kwarg but your overloaded save() method doesn't accept it. > I don't think that this is bad though: A user has to change your her > code to reach this point, so it's her responsibility to change her > code of the overloaded save(), too.
Yes, it's effectively a non-issue in that case. If somebody wants to support the micro-control in the overridden save method, they can add it. But they don't need to. Let's keep in mind here that the need for this micro-control is very much the minority case. It's not a non-existent case, but pretty much all code won't care or need to change. After all, code for which this is currently a requirement cannot be written using Django's save, by definition. All current code accepts the current behaviour as correct and, if they don't change a single thing, they'll continue to do that. Malcolm -- A conclusion is the place where you got tired of thinking. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---