O'Reilly logo

Sams Teach Yourself Django in 24 Hours by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Django Form Field Objects

This appendix is a quick reference for when you add fields to forms. The first section of this appendix discusses the different types of field objects. The second section discusses the Widget objects that translate to HTML elements. The third section discusses form field to model field mapping.

Field Objects

You can add several different types of fields to forms. The advantage of different types of fields is that the form can more closely match the data types that are put into it and validated.

The following sections describe the different types of Field objects.

BooleanField

The BooleanField is used to display an HTML checkbox input element. The following list describes the BooleanField:

  • Default Widget: CheckboxInput ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required