﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6707	ManyToManyField clears and recreates all data	favo <favo@…>	Loic Bistuer	"Current ReverseManyRelatedObjectsDescriptor implement set method:
 1. clear all data
 2. set to new data.

This may cause a huge data changes, especially when using Django Admin, the default M2M field save_form_data() method use the set method to maintain m2m data from form:
{{{
    def save_form_data(self, instance, data):
        setattr(instance, self.attname, data)
}}}

In most case we just want to add remove a small set data from m2m relaionship list. This patch use another implementation, first it delete all exist rows but not in the new data list, then only add new data which not in database.

"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed		kmike84@… sfllaw@… jblaine@… bradley.ayers@… flavio.curella@… botondus@… info@… info@… cmawebsite@… toracle@…	Accepted	1	0	0	0	0	0
