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

Advanced widgets

From the course: Django: Forms

Start my 1-month free trial

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…

Contents