[Django]-When is the "post_save" signal in django activated/called?

3👍

post_save is sent at the end of Model.save_base(), which is itself called by Model.save((). This means that if you override your model’s save() method, post_save is sent when you call on super(YourModel, self).save(*args, **kw).

If Tag has a ForeignKey on Test and the Test instance was just created, you can’t expect to have any Tag instance related to your Test instance at this stage, since the Tag instances obviously need to know the Test instance’s pk first so they can be saved too.

0👍

The post_save for the parent instance is called when the parent instance is saved. If the children are added after that, then they won’t exist at the time the parent post_save is called.

Leave a comment