Formatting fixed, please use 'Preview' to check formatting, thanks.
If we don't save M2M objects to the DB immediately when running add()
, when do we save them? save()
doesn't do that, we would need a 'flush-everything-to-the-database' call, which we don't have. Adding one would require a fundamental change to the way that the ORM works - essentially something like the unit-of-work pattern in SQLAlchemy.
I'm therefore closing WONTFIX.
Note that saving the Group object first doesn't necessarily mean you need to call save()
twice - the add()
calls do not need to be followed by save()
. (I'm guessing you may have reasons why it is this way in your case, but I don't think the situation is forced on you by Django).