#3263: ValueError on form.save() for form_for_model and form_for_instance with
ManyToManyField
------------------------------+---------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Type: defect | Status: new
Priority: normal | Milestone: Version 1.0
Component: django.newforms | Version: SVN
Severity: normal | Keywords: newforms ManyToManyField
------------------------------+---------------------------------------------
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)
--
Ticket URL: <http://code.djangoproject.com/ticket/3263>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---