0

I having Model field which has ManyToMany field in which i want to select the multiple selection. The default selection will be shown. How to override to show Sumo select instead of that.

1 Answers1

0
class SampleForm(forms.ModelForm):
    many_to_many_field = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple, queryset=ModelName.objects.all())

class Meta:
    model = ModelName
    fields = "__all__"

You can specify which widget you want here.

Atley Varghese
  • 576
  • 4
  • 10