forms.NumberInput

class NumberInput [source] Text input: <input type="number" ...> Beware that not all browsers support entering localized numbers in number input types. Django itself avoids using them for fields having their localize property set to True.

forms.NullBooleanSelect

class NullBooleanSelect [source] Select widget with options ‘Unknown’, ‘Yes’ and ‘No’

forms.NullBooleanField

class NullBooleanField(**kwargs) [source] Default widget: NullBooleanSelect Empty value: None Normalizes to: A Python True, False or None value. Validates nothing (i.e., it never raises a ValidationError).

forms.MultiWidget.render()

render(name, value, attrs=None) [source] Argument value is handled differently in this method from the subclasses of Widget because it has to figure out how to split a single value for display in multiple widgets. The value argument used when rendering can be one of two things: A list. A single value (e.g., a string) that is the “compressed” representation of a list of values. If value is a list, the output of render() will be a concatenation of rendered child widgets. If value is not a li

forms.MultiValueField.widget

widget Must be a subclass of django.forms.MultiWidget. Default value is TextInput, which probably is not very useful in this case.

forms.MultiWidget.decompress()

decompress(value) [source] This method takes a single “compressed” value from the field and returns a list of “decompressed” values. The input value can be assumed valid, but not necessarily non-empty. This method must be implemented by the subclass, and since the value may be empty, the implementation must be defensive. The rationale behind “decompression” is that it is necessary to “split” the combined value of the form field into the values for each widget. An example of this is how Split

forms.MultiWidget

class MultiWidget(widgets, attrs=None) [source] A widget that is composed of multiple widgets. MultiWidget works hand in hand with the MultiValueField. MultiWidget has one required argument: widgets An iterable containing the widgets needed. And one required method: decompress(value) [source] This method takes a single “compressed” value from the field and returns a list of “decompressed” values. The input value can be assumed valid, but not necessarily non-empty. This method must b

forms.MultiWidget.format_output()

format_output(rendered_widgets) [source] Given a list of rendered widgets (as strings), returns a Unicode string representing the HTML for the whole lot. This hook allows you to format the HTML design of the widgets any way you’d like. Here’s an example widget which subclasses MultiWidget to display a date with the day, month, and year in different select boxes. This widget is intended to be used with a DateField rather than a MultiValueField, thus we have implemented value_from_datadict():

forms.MultiValueField.require_all_fields

require_all_fields Defaults to True, in which case a required validation error will be raised if no value is supplied for any field. When set to False, the Field.required attribute can be set to False for individual fields to make them optional. If no value is supplied for a required field, an incomplete validation error will be raised. A default incomplete error message can be defined on the MultiValueField subclass, or different messages can be defined on each individual field. For example

forms.MultiValueField

class MultiValueField(fields=(), **kwargs) [source] Default widget: TextInput Empty value: '' (an empty string) Normalizes to: the type returned by the compress method of the subclass. Validates the given value against each of the fields specified as an argument to the MultiValueField. Error message keys: required, invalid, incomplete Aggregates the logic of multiple fields that together produce a single value. This field is abstract and must be subclassed. In contrast with the single-va