Skip to main content

IntegerRangeField

This class provides a specialized form field for handling ranges of integer values. It utilizes an underlying integer field for individual inputs and represents the resulting data as a numeric range object. The field includes built-in validation to ensure that both inputs are valid whole numbers.

Attributes

AttributeTypeDescription
default_error_messagesdict = {"invalid": _("Enter two whole numbers.")}A dictionary containing the default error message for invalid input, specifically instructing the user to enter two whole numbers.
base_field[Field](../../../../forms/fields/field.md?sid=django_forms_fields_field) = forms.IntegerFieldThe form field class used to validate each individual value within the range, which is set to IntegerField.
range_typeclass = NumericRangeThe Python type used to represent the range of integers, specifically a NumericRange object.

Constructor

Signature

def IntegerRangeField() - > null

Signature

def IntegerRangeField() - > null