Example #1
0
    def clean_Name(self):
        Name = self.cleaned_data["Name"]

        if Name.startswith('a'):
            raise forms.ValidationError(" baohan ale ")

        if isNoneOrEmpty(Name):
            raise forms.ValidationError("名称不能为空.")

        return Name
Example #2
0
    def clean_title(self):
        title = str(self.cleaned_data["title"])
        if isNoneOrEmpty(title):
            raise forms.ValidationError("标题不能为空")

        return title