[patch] Faster many-to-many field assignment
|Reported by:||Owned by:||Adrian Holovaty|
|Component:||Database layer (models, ORM)||Version:|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently code such as
article.publications = list_of_n_publications uses n SELECTs. This simple patch adds all related m2m objects at once, thus reducing the amount of SELECTs to one.
Test coverage: Django tests in modeltests/many_to_many cover this area and they all pass.