August 2016
Beginner to intermediate
717 pages
15h 24m
English
It is possible to use all types of field models in the forms. Indeed, some types of model fields have been created for a particular use in forms. For example, the TextField model field has nothing different from CharField except the fact that by default, in the form, the TextField field displays a <textarea> tag and a <input type="text"> name. So, you can write a form field as follows:
field1 = forms.TextField()
The following options are common to all the form fields:
error_messages: This specifies a series of error messageshelp_text: This sets a help messagerequired: This defines a field that must be filled initial: This sets the default value for the fieldvalidators: This defines a particular validator ...Read now
Unlock full access