On Oct 26, 7:54 pm, refreegrata <refreegr...@yahoo.com> wrote: > maybe I not explain correctly. For any modelForm the forms for a field > "ManytoMany" are "select multiple". If I want to change this I must > to redefine the widget for that field in the declaration of the > "modelForm". This works correctly, I can transform the field from > "select multiple" to any "form" that I want. The problem appear when I > want to save the "form". Always the "form" is invalid because the > field type isn't a "select multiple". With a "select multiple" the > form can be saved, with other field types fail. Somebody have an idea? > Something that i can do in the view? Any opinion can be helpful. > > Thank for read
I don't understand why you want to use a ManyToMany with a single select widget. The reason why it doesn't work is that that widget doesn't make sense for that field - a ManyToMany field has *many* related values, hence the name. If you think you need a single select, then it seems your model structure is wrong, and you should be using a ForeignKey rather than a ManyToManyField. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.