Are the objections being raised for `update()` equally applicable to `update_or_create()`?
I would have thought that a name-space clash for this method on the objects manager would have been a non-issue, as would any confusion about the use of `force_update` and `force_create` internally (as they are implied in the method name, they should be used internally for each respective option). I agree about the `default` name mis-match, but I can easily live with that as it provides the same interface as `get_or_create()`. Cheers. Tai. On Mar 23, 10:54 pm, Russell Keith-Magee <freakboy3...@gmail.com> wrote: > On Mon, Mar 23, 2009 at 7:57 AM, Malcolm Tredinnick > > <malc...@pointy-stick.com> wrote: > > > Kind of disappointed that none of the other "commit at will" people have > > chimed in on this one (Adrian? Jacob? Russell? Bueller?...) I suspect > > I'm going to lose, but I'd genuinely like to know that there's something > > more than apathy behind the approval to add this. > > I'm -0, for mostly the same reasons as Malcolm. > > * "fairly common" is hard to quantify, and the code that is being > replaced isn't that hard to hand-roll as an end-user. > * If we include it, there's a backwards incompatibility issue to deal with. > * My goat (or is that pony?) entrails agree with Malcolm's > predictions of "what about insert()/when to use force_update" > discussions. > > My opinion on the 'code cleanliness' issue is acutally the opposite to > Jacob - I actually prefer the obj.x=val; obj.save(force_update=True) > version, for "explicit over implicit" reasons. However, as Jacob > notes, this is a beauty in the eye of the beholder thing. > > I also have a slight problem with update_or_create method as > described. For me, 'default' implies that any existing value will take > precedence, but in update_or_create, the 'defaults' are effectively > the new values. This is a bit of a bikeshed thing, but it does grate. > > However, I don't have any particularly compelling reason to _not_ > include this feature. My -0 is purely my perception of the balance of > benefits vs risks, but it's a pretty fine balance. I won't lose much > sleep over this either way. > > Russ %-) --~--~---------~--~----~------------~-------~--~----~ 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 django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---