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 want this custom action to
> execute when updating an existing model instance.
>
> How do I distinguish between an "insert" and an "update" as django
> uses save() for both?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to