﻿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
3263	[patch] ValueError on form.save() for form_for_model and form_for_instance with ManyToManyField	jhilyard@…	Adrian Holovaty	"The database API wants a list of related object instances, not the list of primary key values supplied by clean_data (actually integers as unicode strings) when you .save() a form_for_model or form_for_instance instance.

ValueError at /edit/news/2/
objects to add() must be Audience instances
Request Method: 	POST
Request URL: 	[my url]
Exception Type: 	ValueError
Exception Value: 	objects to add() must be Audience instances
Exception Location: 	/usr/lib/python2.4/site-packages/django/db/models/fields/related.py in _add_items, line 327

here are the relevant bits of the models:

class News(models.Model):
    audiences = models.ManyToManyField(Audience,filter_interface=models.HORIZONTAL)

class Audience(models.Model):
    name = models.CharField(maxlength=64,unique=True,db_index=True)
"	defect	closed	Forms	dev	normal	fixed	newforms ManyToManyField		Accepted	1	0	0	1	0	0
