From the course: Django: Forms
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Formsets: Multiple forms on a page
- [Instructor] We've gone very in-depth with forms, but I'm here to take you to the next level by talking about something called form sets. Form sets allow you to take one form and repeat it over and over, so in our case, people could order multiple pizzas at once. So, form sets take some work. We're going to have to move step by step in order to get this live, but let's go ahead and start here inside of our order.html. And we want to be able to send people over to our order page to order multiple pizzas, so let's go ahead and put in a few BR tags so that there's enough space in between the above order form and what we're creating down below. Then what we want to have is ask the user something like, want more than one pizza, question mark. Then, what we're going to do is provide a new form. So, this form, all it's going to do is take us to the multiple pizza order page, but it's going to show how many pizzas that they want. So, with this form, we'll create an action, and this action…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Adding models5m 59s
-
(Locked)
Model forms4m 1s
-
Working with widgets5m 37s
-
(Locked)
Advanced widgets4m 23s
-
(Locked)
Forms and files4m 4s
-
(Locked)
Formsets: Multiple forms on a page5m 18s
-
(Locked)
Formset views6m 34s
-
(Locked)
Controlling the number of formsets5m 40s
-
(Locked)
Editing objects4m 40s
-
(Locked)
Input confirmation4m 7s
-
(Locked)
-
-