Django pre_save signal: check if instance is created not updated, does kwargs['created'] (still) exist?
问题 I am using Django's pre_save signal to implement auto_now_add. There is a lot of discussion on the internet on why you should or shouldn't implement it yourself. I do not appreciate comments on this. Neither on whether I should be rewriting the save function (I have a lot of models that use auto_now_add so using signals makes sense). My question is: I would like to check if the instance is created or updated. According to some sources on the internet this can be done by testing if kwargs[