On Tue, 2007-07-24 at 20:59 +0800, Russell Keith-Magee wrote: > On 7/24/07, PyMan <[EMAIL PROTECTED]> wrote: > > > > Can anyone tell me why Django do this while using save()? : > > The behavior comes from the Object relational mapping (key word - > Object). Since save() is an operation on an Object relational mapper, > it was established as an unambiguous mechanism to get object instance > X onto the database. This means creating a row if one doesn't already > exist, and updating the existing row if it does. > > > Am I wrong? What am I missing? Surely something, please tell me what. > > You're not the first to suggest insert() and update() methods that > explicity do SQL INSERT and UPDATE calls. I have a vague recollection > that a decision was made about adding these calls,
Late to the party here, since I'm catching up on a backlog, but I can possibly add some historical value... No really decisive consensus was reached. The problem is that insert() and update() methods don't solve many (any?) problems at all and they avoid solving things like the session collision problem and a number of the subtleties for custom primary keys (which were the only times they are really needed). I don't think they're necessary to this particular issue, either. I had a feeling there's a reason for the current setup, but I can't remember it right now. I'll try to recall. Using something like REPLACE or other extensions will be easier with the new query creation. We can revisit that then (I already have a note about it in my work). Cheers, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---