class RequestForm(forms.ModelForm):
""" Online request.
"""
class Meta:
model = Request
fields = ["language", "daytime", "daysofweek", "phone", "email", "name"]
widgets = {
'language': forms.Select(),
'daytime': RadioSelectNotNull(),
'daysofweek': forms.CheckboxSelectMultiple()
}
如何安裝強制性填寫'phone'或'email'兩個字段之一?如何在django表單中設置不必要的字段?