Skip to main content

ComboField

A Field whose clean() method calls multiple Field clean() methods.

Attributes

AttributeTypeDescription
fieldslistA list of Field instances used to sequentially validate and clean the input value.

Constructor

Signature

def ComboField(
fields: list,
**kwargs: dict
)

Parameters

NameTypeDescription
fieldslistA list of Field instances to be used for validation.
**kwargsdictAdditional keyword arguments passed to the parent Field class.

Signature

def ComboField(
fields: list,
**kwargs: dict
) - > null

Parameters

NameTypeDescription
fieldslistA list of Field instances that will be used sequentially to validate the input value.
**kwargsdictAdditional keyword arguments passed to the parent Field constructor, such as label or help_text.

Methods


clean()

@classmethod
def clean(
value: any
) - > any

Validate the given value against all of self.fields, which is a list of Field instances.

Parameters

NameTypeDescription
valueanyThe raw input value to be validated and transformed by the sequence of internal fields.

Returns

TypeDescription
anyThe cleaned and validated value after it has been processed by every field in the sequence.