On Thu, 2009-03-19 at 14:21 -0700, Delta20 wrote:
> I'm getting the error "Cannot set values on a ManyToManyField which
> specifies an intermediary model." when I try to call form.save_m2m()
> and I would appreciate any tips as to how to work around this.

The error is telling you exactly what the problem is. You can't do the
automatic assignment to many-to-many relations that use an intermediate
table. The reason being that the whole point of an intermediate table is
that it has *extra* information specified on it (otherwise you could
just use a normal ManyToManyField). So you need to create objects with
that extra information and save then explicitly.

Short version is you can't use save_m2m() in that case for precisely
this reason. You'll need to extract out the necessary data from the
form, and save it on the intermediate model.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to