Forms are great not only for creating objects, but also for editing them. Learn how to edit a pizza order in this video.
- [Instructor] Well now that we can save pizzas. … How great would it be if we could … allow the user to edit a pizza? … And that's exactly what we're going to do here. … So let's go ahead and make a new path … for someone to edit a pizza order. … We'll copy our existing pizzas. … And we're going to change this to be order/ … and then inside of angle brackets … we're going to say int:pk and this is to say … they can add a primary key for what pizza … it is that they're looking for. … So we'll change this to be edit_order … and we'll do the same thing for the name. … So, we have a new URL path here. … The next step for us is to move over to our views. … We're going to have to be working with a pizza model. … So let's go ahead and import that. … We'll say from.modelsimportPizza, great. … And then the next step for us is to say okay, … if someone's going to create a pizza, … let's go ahead and save that into something. … So we're going to say created pizza is equal … to whenever the saved form is filled. …
- 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
Building RESTful Web APIs with Djangowith Rudolf Olah1h 9m 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.