On Mon, 2008-04-28 at 00:28 -0700, ludvig.ericson wrote:
> > (1) Model.save(must_create=None) where "must_create" is True (must
> > create), False (must not create) or None (try an update; if that fails,
> > insert).
> >
> > (2) Model.save(method=DEFAULT) and this time "method" takes one of three
> > constant values (making up the names a bit): "DEFAULT", "MUST_CREATE",
> > "MUST_UPDATE".
> >
> > (3) Model.save(must_create=False, must_update=False).
> 
> -1 on all three. They all break existing code very, very much. As you
> noted, 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.

        >>> def f(x=3):
        ...     print x
        ... 
        >>> f()
        3

Malcolm

-- 
Quantum mechanics: the dreams stuff is made of. 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to