﻿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
13757	Signal inconsistency between auto_created and manually defined intermediate models for m2m fields	George Sakkis	nobody	"In Django 1.2 the the signal handling for m2m fields differs based on whether the intermediate model is auto_created or defined manually. As per http://groups.google.com/group/django-developers/msg/2aa826b200e60294:

 * For m2m fields with auto_created intermediate model, calling `Model.m2m_field.add/remove/clear` sends m2m_changed. However adding/removing relations using directly the through model (e.g. `Model.m2m_field.through.objects.create(...)`) does not send m2m_changed. Adding handlers for pre/post_save, pre/post_delete on the through model has no effect; the code specifically checks for auto_created models and does '''not''' send these signals in this case.

 * For m2m fields with a given intermediate model, `Model.m2m_field.add/remove` are not exposed (at least for now but this may change, see #9475) and therefore m2m_changed is not sent; instead you have to handle addition/removal in pre/post_save, pre/post_delete handlers on the through model. However `Model.m2m_field.clear()` is exposed and does send m2m_changed; if there are pre/post_delete handlers on the through model, they are called as well after the m2m_changed. 
"	Bug	new	Database layer (models, ORM)	dev	Normal		m2m signals	Yiling-J	Accepted	0	0	0	0	0	0
