With formsets, the user can create many new objects. You can control and put limits on this as to not get too many. Explore this more in this video.
- [Nick] So we have the correct code … to handle a post request, … but we have nothing for a get request. … So, let's go ahead and provide an else statement here … for it's not a post request, we'll assume that it's a get. … And in this situation, we need to return a render … just like above, and it'll be all the same, … except for we won't be providing the notes. … So we'll go ahead and remove the note that we have there. … But we'll still be providing the formset … 'cause we want people to be able to order a pizza. … Now, with that in place, … we've got to go create a new template. … So under here, I'm going to create a new pizzas.html. … And inside of our pizzas.html, … we want a few pieces of information, … so let's make like a h1 tag. … This is going to tell the user that … they can order pizzas, so we'll say Order Pizzas, OK? … If there is a note, we'll want to know about that as well. … We'll make this a little bit less as an h2 tag, … but this is simply going to hold our note, information. …
- Creating form fields
- Using submitted data
- Adding models
- Using the ModelForms class
- Working with widgets
- Accepting files and multiple forms on a page
- Customizing formsets
- Using local validation
- Delivering errors responsibly
- Customizing forms
- Styling with CSS
Skill Level Intermediate
1. Getting Started with Forms
2. Working with Advanced Form Features
3. Customizing and Styling Form Appearance
Next steps1m 19s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.