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.widgets

widgets An iterable containing the widgets needed. And one required method:

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.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.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.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.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.fields

fields A tuple of fields whose values are cleaned and subsequently combined into a single value. Each value of the field is cleaned by the corresponding field in fields – the first value is cleaned by the first field, the second value is cleaned by the second field, etc. Once all fields are cleaned, the list of clean values is combined into a single value by compress(). Also takes one extra optional argument: