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

  • SEARCH
  • Home
  • 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 7611297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:38:12+00:00 2026-05-31T01:38:12+00:00

For a questionnaire, I want to present a sequence of forms to the user.

  • 0

For a questionnaire, I want to present a sequence of forms to the user. I’d like to keep the view generic, so that it can present any form instance in the sequence.

Currently, I’m storing a list of the form objects (not instances), and I instantiate each form as it needs to be presented. (e.g. formobject = formslist[3]; form = formobject();).

Is there a more pythonic way of doing this? I’ve considered using a getnext function in the definition of each form, but I still need a place to list the sequence of forms that I want to generate.

The next step will be to introduce some skip-logic, so hardwiring the form sequence is not ideal.

Maybe this will help. This is what I have in my view, using a getnext function. It works from the first form to the second, but then does not serve the third form:

def showform(request):
    if 'formobj' not in locals():
        formobj = StartForm

    if request.method == 'POST': # If the form has been submitted...
        form = formobj(request.POST)

        if form.is_valid():
            try:
                form.save()
            except:
                pass
            cd = form.cleaned_data
            formobj = form.get_next()
            form = formobj()
            if formobj == 'done':
                render_to_response('doneform.html', context_instance=RequestContext(request))
            else:
                form = formobj()
    else:
        form = formobj()

    return render_to_response('template.html', {'form': form, 'requestpath': request.get_full_path()}, context_instance=RequestContext(request))
  • 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-31T01:38:13+00:00Added an answer on May 31, 2026 at 1:38 am

    Have you looked at this for saving data during form wizard steps

    Using FormWizard and saving the forms data in between before the completion of the whole process?

    Also mentioned in that post is an app called django-merlin which may do what you need. I’ve not personally used it though.

    Edit

    Here is another post that might be helpful to you
    Django – form wizard step by step

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

Sidebar

Related Questions

I have a form that I want to use to collect user information. I
User have to populate multistep questionnaire web-forms and step messages depend on the option
I want to make something like a questionnaire with different sections. Therefore, I created
I have a CakePHP website that acts as a questionnaire. It moves the user
I have a questionnaire stored in a XML column that I want to store
Curious what recommendations anyone has. I have an existing asp.net forms application that does
I am building a questionnaire, and i want to save the number of questions
I have an MVC questionnaire app that loops through a set of questions <%
I use rails_admin One of my partial is like this : %b= questionnaire.title -
I have a MVC, ASP.Net application and I want to create a dialog form.I

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.