The documentation may use a little clarification.
save_model is called during add or change to save the base model. It is not specifically designed to save related or embedded models.save_related is called (once) after save_model completes to save all related / inline models.save_formset is called potentially many times during each addition / change, once for each inline string defined on ModelAdmin . It is called by the implementation of the save_related base class.
If you look at the admin.ModelAdmin code, you will see that save_model and save_related happen one after another:
class ModelAdmin(BaseModelAdmin): def changeform_view(...):
and that save_related has a simple implementation for calling save_formset for each row:
class ModelAdmin(BaseModelAdmin):
source share