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 8067817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:27:25+00:00 2026-06-05T12:27:25+00:00

Main question is whether there is any method to bundle many django forms into

  • 0

Main question is whether there is any method to bundle many django forms into single instance, to make clear what I need to explain my problem:

I have created bunch of form classes that need to work together to display a single view.

    from_form = move_forms.WaypointForm(prefix="marker-from", instance=move.from_place)
    to_form = move_forms.WaypointForm(prefix="marker-to", instance=move.to_place)
    #Notice that last two form are of the same class 
    through = ThroughFormset(prefix="through", queryset=move.waypoints_db.all())
    path_form = move_forms.CarMovePathForm(path=move.path)
    date_form = move_forms.MoveForm(instance=move)

    #put all this into context instance and render

All these forms basically display/edit the same instance of database — but are reused throught the app in different configurations (so I cant just manually create class that will encapsulate it).

Having many forms in a webpage is a nuisance, for example I have to write code like that:

 if transportation_form.is_valid() and from_form.is_valid() and \
    to_form.is_valid() and through.is_valid() and path_form.is_valid():

I can’t pass cleanly form property to views since most vievs use many forms in such manner.

Is there any sensible way to bundle these forms — or is just my design broken (if so how to fix it).

  • 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-06-05T12:27:26+00:00Added an answer on June 5, 2026 at 12:27 pm

    What about this

    from_form = move_forms.WaypointForm(
        request.POST or None,
        prefix="marker-from",
        instance=move.from_place)
    # ... other forms declared the same way
    
    forms = {
        'from_form': from_form,
        'to_form':  to_form,
        # ...
    }
    if all(f.is_valid() for f in forms.values()):
        # ...
        return redirect('success')
    return render(request, 'template.html', {'forms': forms})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question, is there a way to call your main method whatever you like
Inspired by this question , I'd like to know whether there is any trick
I am using Struts2, Spring 2 and Junit 4.5. My main question is, whether
My main question is : Is there a good practice to serve binary files
Here's the main question I guess : Is there a .NET way to get
My question is based on curiosity and not whether there is another approach to
Main question is what are the implications of allowing the this keyword to be
My main question is given a feature centroid, how can I draw it in
The title is the main question. The exact scenario (I am 'using namespace std;'):
This was the main question posed by Greg Wilson's bits of evidence presentation. I'm

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.