First, I fixed the description formatting. Please use preview (and wiki format) to make sure things are readable before submitting.
Replying to AdamG:
My guess is that BaseModelFormSet.save_existing_objects()
is skipping the form because form.has_changed()
is False.
Yes the problem is likely related to the fact that the form has not been changed, though I think it is the has_changed in save_new that is causing the issue here. Thing is, if nothing has changed, how is the admin code supposed to figure out that a new item should be created? I don't believe it is always the case that you'd want admin creating objects with all defaults (actually I'm pretty sure there was once a bug because admin did that). I am not sure that the admin interface, as it currently exists, supports what is being asked for here. There is currently no explicit "add this item" checkbox (as there is for delete), thus the admin has to figure out the right thing to do. It does that now by seeing if anything has changed since the form was presented to the user. If yes, then an object is added. If no, then no new object is created. I don't quite see how to support this use case, and also the case where you don't want all-default objects created (which is also valid), without a pretty significant change in the admin interface here.