【发布时间】:2012-10-18 12:32:21
【问题描述】:
forms.py
class MyForm(forms.Form):
no = forms.CharField(error_messages={'required': u'must be xxx')
模板.html
{{form.no.error}}
{{form.no.error}} 是 <ul class="errorlist"><li>must be xxx</li></ul>
我想将{{form.no.error}} 格式化为没有任何html标签的纯文本消息
【问题讨论】:
-
这在此处的文档中有介绍:docs.djangoproject.com/en/dev/topics/forms/…