Re: custom action during "insert" but not during "update"

2008-06-07 Thread chefsmart
Alex, Julien That was it -- thanks. On Jun 8, 10:37 am, Julien <[EMAIL PROTECTED]> wrote: > As alex says, testing the primary is the only way that I know of: > > def save(self): >     if self.pk is None: >         # Here's we're creating a new object >     else: >         # Here we're updating

Re: custom action during "insert" but not during "update"

2008-06-07 Thread Julien
As alex says, testing the primary is the only way that I know of: def save(self): if self.pk is None: # Here's we're creating a new object else: # Here we're updating an existing object On Jun 8, 2:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If you overide

Re: custom action during "insert" but not during "update"

2008-06-07 Thread [EMAIL PROTECTED]
If you overide model.save() just check for self.pk to be set. On Jun 7, 11:19 pm, chefsmart <[EMAIL PROTECTED]> wrote: > Hi All, > > I need some insight on the following scenario: > > I want to execute some custom action when creating new model instances > when calling model.save(), but I don't

custom action during "insert" but not during "update"

2008-06-07 Thread chefsmart
Hi All, I need some insight on the following scenario: I want to execute some custom action when creating new model instances when calling model.save(), but I don't want this custom action to execute when updating an existing model instance. How do I distinguish between an "insert" and an