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.
Advanced widgets
- [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. There's…
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)
-
-