django formWizardを使おうとすると、すべて問題ありませんが、送信後の最後のステップでエラーが発生します
Traceback (most recent call last):
File "/home/vacantes/webapps/django/lib/python2.6/django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/vacantes/webapps/django/lib/python2.6/django/utils/decorators.py", line 21, in _wrapper
return decorator(bound_func)(*args, **kwargs)
File "/home/vacantes/webapps/django/lib/python2.6/django/utils/decorators.py", line 76, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/vacantes/webapps/django/lib/python2.6/django/utils/decorators.py", line 17, in bound_func
return func(self, *args2, **kwargs2)
File "/home/vacantes/webapps/django/lib/python2.6/django/contrib/formtools/wizard.py", line 101, in __call__
return self.done(request, final_form_list)
File "/home/vacantes/webapps/django/hay_vacantes/curriculums/forms.py", line 56, in done
website = data['website']
TypeError: __init__() got an unexpected keyword argument 'website'
問題がどこにあるのかわかりません。モデルにはWebサイトのフィールドがありますが、なぜエラーが発生するのでしょうか。
model.py
class Generales(models.Model):
usuario = models.OneToOneField(User,unique=True)
.....
estado_civil = models.SmallIntegerField(max_length=1,choices=CIVIL)
website = models.URLField(verbose_name='Website', verify_exists=False,null=True,blank=True)
そして私の形で:
forms.py
#others forms
.....
class ContactWizard(FormWizard):
def done(self, request, form_list):
data = {}
for form in form_list:
data.update(form.cleaned_data)
generales = Generales(
usuario = request.user.id,
documento_identidad = data['documento_identidad'],
tipo = data['tipo'],
tel_fijo = data['tel_fijo'],
celular = data['celular'],
foto = data['foto'],
sexo = data['sexo'],
direccion = data['direccion'],
codigo_postal = data['codigo_postal'],
pais = data['pais'],
ciudad = data['ciudad'],
fecha_nacimiento = data['fecha_nacimiento'],
estado_civil = data['estado_civil'],
website = data['website']
)
generales.save()
# others forms
.....
return HttpResponseRedirect('/panel/completo/')
編集
urls.py
from vacantes.curriculums.forms import Generales,Areas,Experiencia,Referencias,ContactWizard
urlpatterns = patterns('',
url(r'^completar/$', ContactWizard([Generales, Areas,Experiencia,Referencias])),
)
formwizardのようにデータを保存する必要があるかどうかはわかりませんが、試しています。
エラーについて何か考えはありますか?
ありがとう