On 3/1/07, David Danier <[EMAIL PROTECTED]> wrote: ... > Perhaps save() could be change to actually do this: > (As I started writing my own DB-abstraction-layer once, I know this can > become very handy) > ----------------------------------------------------------------------- > def save(self): # simplified > if self.id: > self._update() > else: > self._insert()
The current code is: if pk_set: check if a record with that pk exists. if it does, do an update. if it does not, do an insert. else: do an insert. If you abandon the record check when pk_set, then you lose the ability to manually specify an ID for use in insert. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---