Django FormWizard Keep Values Between Steps

18 views
Skip to first unread message

Nelson Diaz

unread,
Oct 7, 2016, 7:31:06 AM10/7/16
to Django users
# forms.py
class ContactForm1(forms.Form):
    subject = forms.CharField(max_length=100)

class ContactForm2(forms.Form):
    sender = forms.CharField(required=False)

class ContactForm3(forms.Form):
    message = forms.CharField(widget=forms.Textarea,required=False)

# views.py
class ContactWizard(SessionWizardView):
    template_name = "contact_form.html"

    def done(self, form_list, **kwargs):
        form_data = process_form_data(form_list)
        return render_to_response('done.html', {'form_data': form_data})

ludovic coues

unread,
Oct 7, 2016, 8:16:06 AM10/7/16
to django...@googlegroups.com
I would use only one form and only display a few field on each step of
the wizard
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8750c145-71dc-42f6-ae48-3c632c10a96d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42
Reply all
Reply to author
Forward
0 new messages