Hi,
I have django ModelForm
for model with ManyToManyField. I want to change widget for this field toCheckboxSelectMultiple
. Can I do this without overriding a field in a form definition?
I constantly use code similar to this:
class MyModel(ModelForm):
m2m_field = forms.ModelMultipleChoiceField(queryset = SomeModel.objects.all(),
widget = forms.CheckboxSelectMultiple())
Is there other way to do this?
EDIT: I need this for Django 1.1.1 project