1👍
✅
You can do this with post_save
signal, or by overriding the model’s save()
method.
In post_save()
signal method, you can use the created
argument to find out whether it’s new object or updated object. In overridden save()
method, that would be done with the condition: if not self.pk:
.
Source:stackexchange.com