Once a user has sent you the information, you need to be able to use it. In this video, see how to use and safely access the submitted form data.
- [Instructor] So something that's wrong with our form … right now is we can have all this great information, but … when we hit order pizza, there's no place for us to capture … the information that it has been sent via the form. … So let's talk about how we can do that. … Well because we've submitted this via a post request, … let's go ahead and move back to our views.py, … and inside of our order function, let's do a distinction … to say if we're in a post request or a get request, … we want to handle it a certain way. … So we'll do that with an if request.method is equal to, … make sure you have the two equal signs there, … in all caps POST, then we'll want to handle it … one type of way, and then in an else situation, … we'll want to return what we've just been doing before. … So I'll go ahead and do the tab over on that for those two. … But let's talk about what happens if it's a post request, … and we've been sent some information. … Well what we want to do is create a new form, but …
- 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.