Note that there are some explanatory texts on larger screens.

plurals
  1. POFormWizard and saving data
    text
    copied!<p>im trying to use django formWizard, all is fine, but im getting an error in the last step after submit</p> <pre><code> 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' </code></pre> <p>i dont know where is the problem, in my Model i have a website field, but ... why the error?</p> <h1>model.py</h1> <pre><code>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) </code></pre> <p>and in my forms:</p> <h1>forms.py</h1> <pre><code>#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/') </code></pre> <h1>EDIT</h1> <p>urls.py</p> <pre><code>from vacantes.curriculums.forms import Generales,Areas,Experiencia,Referencias,ContactWizard urlpatterns = patterns('', url(r'^completar/$', ContactWizard([Generales, Areas,Experiencia,Referencias])), ) </code></pre> <p>i dont know if im saving the data like formwizard need, but im trying.</p> <p>any idea about the error?</p> <p>thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload