a
Selector and checkbox widgets¶
These widgets make use of the HTML elements <select>, <input type="checkbox">, and<input type="radio">.
Widgets that render multiple choices have an option_template_name attribute that specifies the template used to render each choice. For example, for the Select widget,select_option.html renders the <option> for a <select>.
CheckboxInput¶
- class
CheckboxInput[source]¶ -
input_type:'checkbox'template_name:'django/forms/widgets/checkbox.html'- Renders as:
<input type="checkbox" ...>
Takes one optional argument:
check_test¶-
A callable that takes the value of the
CheckboxInputand returnsTrueif the checkbox should be checked for that value.

浙公网安备 33010602011771号