如何删除我的django ModelForm widgts中的-----? 文档说使用empty_label但它适用于SelectDateWidget
我的表格
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
exclude = ('copy', 'created', 'researcher', 'keywords', 'application_area', 'predominant_area')
widgets = {
'title':forms.TextInput(attrs={
'class':'form-control',
'placeholder': 'Titulo da oportunidade'
}),
'conclusion_date':forms.TextInput(attrs={
'class': 'form-control',
'type':'text',
'placeholder':'Data de conclusão'
}),
'category': forms.RadioSelect(attrs={
'class':'form-control'
}),
'result':forms.Select(attrs={
'class':'form-control'
}),
}
答案 0 :(得分:2)