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
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
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
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
4 matches
Mail list logo