Re: blank ModelMultipleChoiceField, sort a ManyToManyField that is allowed to be blank

2011-02-01 Thread Santiago Caracol
Ah, now there is a new problem. Before, my ManyToManyField was unsorted, but it was possible to add new items by clicking on the "+" button. Now my items are sorted thanks to a ModelMultipleChoiceFormField (with "order_by('...')" and "required=False"), but the "+" button is gone. Is there a way t

Re: blank ModelMultipleChoiceField, sort a ManyToManyField that is allowed to be blank

2011-02-01 Thread Santiago Caracol
> No form fields take that argument - that's for model fields. > > Form fields take the argument "required", which defaults to True. Thank you! That is exactly the information I needed. By the way, is there a special reason why "blank" of model fields translates to "required" of form fields? San

Re: blank ModelMultipleChoiceField, sort a ManyToManyField that is allowed to be blank

2011-02-01 Thread Daniel Roseman
On Tuesday, February 1, 2011 9:45:04 AM UTC, Santiago Caracol wrote: > > Hi, > > why can't a ModelMultipleChoiceField not have the property > "blank=True"? > > I need the ModelMultipleChoiceField to sort the values of a > models.ManyToManyField in a form class. Sorting works as expected, but

blank ModelMultipleChoiceField, sort a ManyToManyField that is allowed to be blank

2011-02-01 Thread Santiago Caracol
Hi, why can't a ModelMultipleChoiceField not have the property "blank=True"? I need the ModelMultipleChoiceField to sort the values of a models.ManyToManyField in a form class. Sorting works as expected, but only if the field is obligatory. (Else, I get the error message "TypeError: __init__() go