【发布时间】:2014-04-26 00:53:08
【问题描述】:
我在模型中使用了默认值
constitucional_64 = models.CharField(max_length=500, null=True,blank=True,default='negado')
问题是当我点击它时我需要从输入中删除值,我在我的 ModelForm 中使用占位符
class ExpedienteInicialform(ModelForm):
class Meta:
model = ExpedienteConsultaInicial
widgets = {
'constitucional_64': forms.TextInput(attrs={'placeholder': 'negado'}),
}
但我需要获取值 'negado' 以将其发送到数据库,占位符工作正常,问题是我没有在 POST 中获取值。
【问题讨论】:
标签: python django forms models placeholder