Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6144233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:37:17+00:00 2026-05-23T18:37:17+00:00

I have one model and I’ve created a form out of the model using

  • 0

I have one model and I’ve created a form out of the model using ModelForm. Now, I want to spread the form across two pages. For example, the first three fields will appear on the first page then the user clicks next and the last three fields appear on the second page. Then he clicks submit and the user submitted data is added to the database.

I took a look at the docs for the Form Wizard and it seems like it would work for model forms as well? Can someone confirm this?

And if it does, can someone explain the process of creating a WizardView class.

This example is given in the docs and I don’t understand what the second two parameters are. Is form_list just a list of form objects that you’ve instantiated based on your form classes? And what is **kwargs?

class ContactWizard(SessionWizardView):
    def done(self, form_list, **kwargs):
        do_something_with_the_form_data(form_list)
        return HttpResponseRedirect('/page-to-redirect-to-when-done/')

Thanks in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:37:18+00:00Added an answer on May 23, 2026 at 6:37 pm

    Form Wizard is being built into Django 1.4 so is a good way to go about this. It should do what you want, but you may need a couple of tweaks.

    Don’t worry about the kwargs in done() at the moment – you’re not going to need them.

    form_list is the list of forms that you want to use for your steps – from urls.py

    urlpatterns = patterns('',
        (r'^contact/$', ContactWizard.as_view([ContactForm1, ContactForm2])),
    )
    

    [ContactForm1, ContactForm2] will be passed to done() as form_list.

    What you will need to do is break your ModelForm into separate forms. The easiest way to do this (if you want your model on several forms) is to not use ModelForm but just create your own form. It’s pretty easy:

    from django import forms
    
    class ContactForm1(forms.Form):
        subject = forms.CharField(max_length=100)
        sender = forms.EmailField()
    
    class ContactForm2(forms.Form):
        message = forms.CharField(widget=forms.Textarea)
    

    Once your forms reflect the portions of your model, just create the views and patterns as described in the docs and set do_something_with_the_form_data(form_list) to a function that completes your model from the form data and then does a save.

    You could use ModelForm but – only if you can persuade it to produce different forms for Form Wizard to use for each step – that’s going to be the tricky part.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one model but two different forms ,one form i am saving through
I have one ManyToMany model that I am using for two fields on a
I have two tables related: DataEntered and Model DataEntered -currentModel Model One DataEntered can
I want to have one model & view that is served by multiple controllers
I am using Ruby on Rails with Active Admin and I have one model
I have one Devise model: User. I am needing two different login views, /login
i have one model for pictures and want to show them in grid view
How can I have one mongo model go to one database and another using
I have one grails application.In that I have one model class named Book. From
I got a simple problem in SQLAlchemy. I have one model in a table,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.