开发者

Django user profile form validation problem

开发者 https://www.devze.com 2023-04-08 17:51 出处:网络
I\'开发者_开发技巧m trying to implement user profile module to my django project, but I\'m getting this error:

I'开发者_开发技巧m trying to implement user profile module to my django project, but I'm getting this error:

Form 'SignupForm' could be validated, while 'ProfileForm' couldn't. Please make sure the two classes are compatible. Validation errors were: * user
  * Обязательное поле.(can't be blank)

My code:

http://pastie.org/2586199

Can anyone help me? Thanks in advance.


You should probably just set the Model meta attribute to your profile class manually instead of grabbing it from the settings:

from some.module import MyProfile
class ProfileForm(forms.ModelForm):
    pass

    class Meta:
        model = MyProfile

That code seems to be vastly over complicating a fairly simple operation

0

精彩评论

暂无评论...
验证码 换一张
取 消