在同一模板上显示forms.ValidationError

时间:2015-08-06 06:43:58

标签: python django forms templates

def clean(self):
        ......
        if reason == choice.MISTAKE:
            if message == "":
                raise forms.ValidationError("This field is required") 
        return data

如何在模板上显示此验证错误? 提前谢谢!

0 个答案:

没有答案