The common pattern for checking if an object is new is testing for:
self.pk is not None
As described in In a django model custom save() method, how should you identify a new object?
But it's not true when the oject is in one-to-one relation to some other object, say:
class X(models.Model):
bla = models.OneToOneField(Bla)
Then if I want to create this object instance and save it to database I have do this:
x = X(bla=someBla)
x.save()
And x.pk is not null but x.pk = someBla.pk from the very begining.
So is there any posssibility to check if such an object is new or edited?