In a django model custom save() method, how should you identify a new object?

Alternative way to checking self.pk we can check self._state of the model

self._state.adding is True creating

self._state.adding is False updating

I got it from this page

Leave a Comment