So my formwizard is:
class CadastroWizard(FormWizard):
def get_template(self, step):
return ['forms/wizard_%s.html' % step]
def done(self, request, form_list):
data = {}
for form in form_list:
data.update(form.cleaned_data)
user = User(
username=data['email'],
first_name=data['nome'],
email=data['email']
)
user.set_password(data['senha'])
user.save()
tipo = usuario.objects.create(**data)
return render_to_response('cadastro-concluido.html', {'data':
data}, context_instance=RequestContext(request))
Thanks for attention.
- snip-
Arthur, could you please include:
- The original form you are using
- The model that has the "ManyToMany" relationship
- the exact code where you include "areaes"?
The formwizard, by itself, isn't very helpful. My guess is that you
are passing an odd keyword when initializing it.
- j
I'd also ask that you direct this question to django-users.
Django-developers is for discussing the development of Django itself.
If you want help debugging something, you should be asking on
django-users.
Yours,
Russ Magee %-)
areaes = models.ManyToManyField(areavaga,verbose_name='Area da
vaga*')
pret_salario = models.CharField('Pretenção
salarial*',max_length=2,choices=SALARIO_C)
cargointeresse = models.CharField('Cargo de interesse*',max_length
=20)
tipoperfil = models.CharField('Tipo de
perfil*',max_length=2,choices=TIPOPERFIL_C)
forms.py
class usuarioForm(forms.ModelForm):
class Meta:
model = usuario
areaes =
forms.ModelMultipleChoiceField(queryset=areavaga.objects.all())
pret_salario =
forms.ChoiceField(widget=forms.Select(attrs={'class':'validate[required]
select-medium'}), choices=SALARIO_C)
cargointeresse = forms.CharField(max_length =50,
widget=forms.TextInput(attrs={'class':'input-medium
validate[required]'}))
tipoperfil =
forms.ChoiceField(widget=RadioSelect(renderer=HorizRadioRenderer,
attrs={'class':'validate[required]'}), choices=TIPOPERFIL_C)
formwizard
class CadastroWizard(FormWizard):
def get_template(self, step):
return ['forms/wizard_%s.html' % step]
def done(self, request, form_list):
data = {}
for form in form_list:
data.update(form.cleaned_data)
user = User(
username=data['email'],
first_name=data['nome'],
email=data['email']
)
user.set_password(data['senha'])
user.save()
tipo = usuario.objects.create(**data) <<<------- In here!