这是东西.我不确定哪个部分出了问题.请帮帮我!:)我是一个迷茫的ebit混淆哈哈哈
class SignUpForm(forms.ModelForm): fname = forms.CharField(max_length=256, label="", required=True, widget=forms.TextInput(attrs={'class': 'form-control','placeholder': 'First Name','required':True})) lname = forms.CharField(max_length=256, label="", required=True, widget=forms.TextInput(attrs={'class': 'form-control','placeholder': 'Last Name','required':True})) email = forms.EmailField(max_length=256, label="", required=True, widget=forms.EmailInput(attrs={'class': 'form-control','placeholder': 'Email','required':True})) emailConfirm = forms.EmailField(max_length=256, label="", required=True, widget=forms.EmailInput(attrs={'class': 'form-control','placeholder': 'Confirm email','required':True})) password = forms.CharField(max_length=256, label="", required=True, widget=forms.PasswordInput(attrs={'class': 'form-control','placeholder': 'Password','required':True})) datetime = forms.DateTimeInput() class Meta: model=SignUp fields=['fname','lname','email','password',] def clean_fname(self): name = self.clean_data.get('fname') if ' ' in name: raise forms.ValidationError("Please do not have a space in your name.") else: return name
Raja Simon.. 6
那是对的,没有属性clean_data
可能cleaned_data
会帮助你...
那是对的,没有属性clean_data
可能cleaned_data
会帮助你...