views:

49

answers:

0

Form items disappear (forms.ModelMultipleChoiceField) if forms.CharField is not part of the form.

forms.py

class Test(ModelForm):
    name = fields.CharField(max_length=200)
    events = forms.ModelMultipleChoiceField(queryset=Event.objects.all()...


    class Meta:
        model = Events
        fields = ("events", "name")

The above example works fine, but when "name" is removed from fields in forms.py, the template renders empty form.