﻿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
2667	calling Add on a ManyToMany field with empty arguments results in bad SQL	carl.shimer@…	Adrian Holovaty	"Scenario:

You have generic code which wants to add one or more entries to a ManyToMany field.  the easy way to do this is something like this:


{{{
mapping_values = Model_one.object.all.filter(foo__bar__baz__in=mylistcriteria)
exising_object.manytomanyfield.add(*mapping_values)
}}}
if mapping fields is empty,e.g [] this will result in an exception because of bogus SQL generation.
calling add with empty args should probably do nothing rather than throwing an exception. Of course,this is easy to code around with a simplecheck. 
"	defect	closed	Core (Other)		normal	duplicate			Unreviewed	0	0	0	0	0	0
