forms.ChoiceField.choices

choices Either an iterable (e.g., a list or tuple) of 2-tuples to use as choices for this field, or a callable that returns such an iterable. This argument accepts the same formats as the choices argument to a model field. See the model field reference documentation on choices for more details. If the argument is a callable, it is evaluated each time the field’s form is initialized.

forms.ComboField

class ComboField(**kwargs) [source] Default widget: TextInput Empty value: '' (an empty string) Normalizes to: A Unicode object. Validates the given value against each of the fields specified as an argument to the ComboField. Error message keys: required, invalid Takes one extra required argument: fields The list of fields that should be used to validate the field’s value (in the order in which they are provided). >>> from django.forms import ComboField >>> f = Combo

forms.ClearableFileInput

class ClearableFileInput [source] File upload input: <input type='file' ...>, with an additional checkbox input to clear the field’s value, if the field is not required and has initial data.

forms.ComboField.fields

fields The list of fields that should be used to validate the field’s value (in the order in which they are provided). >>> from django.forms import ComboField >>> f = ComboField(fields=[CharField(max_length=20), EmailField()]) >>> f.clean('test@example.com') 'test@example.com' >>> f.clean('longemailaddress@example.com') Traceback (most recent call last): ... ValidationError: ['Ensure this value has at most 20 characters (it has 28).']

forms.ChoiceField

class ChoiceField(**kwargs) [source] Default widget: Select Empty value: '' (an empty string) Normalizes to: A Unicode object. Validates that the given value exists in the list of choices. Error message keys: required, invalid_choice The invalid_choice error message may contain %(value)s, which will be replaced with the selected choice. Takes one extra required argument: choices Either an iterable (e.g., a list or tuple) of 2-tuples to use as choices for this field, or a callable that

forms.CheckboxSelectMultiple

class CheckboxSelectMultiple [source] Similar to SelectMultiple, but rendered as a list of check buttons: <ul> <li><input type='checkbox' name='...' ></li> ... </ul> The outer <ul> container receives the id attribute of the widget, if defined, or BoundField.auto_id otherwise. Like RadioSelect, you can loop over the individual checkboxes for the widget’s choices. Unlike RadioSelect, the checkboxes won’t include the required HTML attribute if the field

forms.CheckboxInput

class CheckboxInput [source] Checkbox: <input type='checkbox' ...> Takes one optional argument: check_test A callable that takes the value of the CheckboxInput and returns True if the checkbox should be checked for that value.

forms.CharField.min_length

min_length If provided, these arguments ensure that the string is at most or at least the given length.

forms.CharField.strip

strip New in Django 1.9. If True (default), the value will be stripped of leading and trailing whitespace.

forms.CheckboxInput.check_test

check_test A callable that takes the value of the CheckboxInput and returns True if the checkbox should be checked for that value.