当我进入管理界面时,所有字段都存在,但在我提交表单后,除了用户名和电子邮件之外,它们都没有任何数据。有什么帮助吗?
class SignupFormExtra(userena.forms.SignupForm):
first_name = forms.CharField(max_length=20)
last_name = forms.CharField(max_length=20, required=False)
gender = forms.CharField(max_length=3, required=False)
phone = forms.CharField(label=(u'Phone Number'),max_length=10, required=False)
cell = forms.CharField(label=(u'Cell Number'),max_length=10)
address = forms.CharField(label=(u'Dental Practice Address'),max_length=50, required=False)
def save(self):
self.cleaned_data['username'] = self.cleaned_data['email']
user = super(SignupFormExtra, self).save()
user.first_name = self.cleaned_data['first_name']
user.last_name = self.cleaned_data['last_name']
#user.birth_date = self.cleaned_data['birth_date']
user.gender = self.cleaned_data['gender']
user.phone = self.cleaned_data['phone']
user.cell = self.cleaned_data['cell']
user.address = self.cleaned_data['address']
user.save()
return user