Getting __init__() got an unexpected keyword argument 'instance' with CreateView of Django

后端 未结 4 1629
无人及你
无人及你 2020-12-10 10:01

Some details:

Request Method: GET
Request URL: http://localhost:8080/user/create
Django Version: 1.5.1
Exception Type: TypeError
Exception Value: ____init__         


        
4条回答
  •  死守一世寂寞
    2020-12-10 10:36

    forms.py Defines Fields in Square Brackets like fields=['field 1', 'field 2',...]

    class CustomerForm(forms.ModelForm):        
        class Meta:
            model = Customer
            fields = ['fname','lname','email','address','city','state','zip','username','password','age','mobile','phone']
    

提交回复
热议问题