November 2015
Beginner to intermediate
840 pages
26h 30m
English
HTML comes with the form tag, which allows for a webpage to query the user for data and send that data to a web resource. Django supplies the Form class to enable developers to quickly generate HTML forms, accept the data they’ve queried the user for, and determine whether that data is valid and safe.
Forms are complex and are best dealt with as finite-state machines with three states. A form (1) may be empty, (2) may contain invalid or insecure data, or (3) may contain valid data.
Forms are similar to models in that developers build subclasses of Form. Form field instances are declared as attributes of the subclass. Much like model fields, form fields are meant to hold a discrete piece of information. However, ...
Read now
Unlock full access