예제 #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
예제 #2
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
예제 #3
0
    def clean_title(self):
        title = str(self.cleaned_data["title"])
        if isNoneOrEmpty(title):
            raise forms.ValidationError("标题不能为空")

        return title