What if you’d like to have users select from a list of options, or a drop-down list? See how to take things to the next level with widgets in this video.
- [Instructor] So you've gotten a nice taste … of the things that we can do with widgets, … but we can do them not only just in a regular form, … but we can also use them in model forms. … So let's go ahead and comment out our top form that we have, … and we will uncomment our model form below … and I'll show you how we can now use widgets … to make some sort of specific change if we'd like to. … So, here below are labels, … let's go ahead and add one more change. … We can say, widgets equal to … and we can specify some sort of widget … that we would like to apply to a particular field. … So like we had done last time, … let's go ahead and specify here topping one … and say with a colon that we want it to use … a particular widget like forms and then capital text area. … So, you'll expect like we saw last time … if we go ahead and save this and reload our page, … all of a sudden toppings one is a huge text area … where the user can fill in some information. … So, nice to know that we can do that inside of model forms. …
- 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.