Skip to main content
Version: 0.5.x

NumberRangeParameterOption (class)

NumberRangeParameterOption objects can be used to define the selectable range and default values of a number range parameter. Note that only one option can appear at a time, but different options may appear based on user attributes or parent parameter selections. This is a subclass of ParameterOption.

The class can be imported from the squirrels.parameter_options or squirrels module.

Constructor

def __init__(
self, min_value: str | int | decimal.Decimal, max_value: str | int | decimal.Decimal, *,
increment: str | int | decimal.Decimal = 1,
default_lower_value: str | int | decimal.Decimal | None = None,
default_upper_value: str | int | decimal.Decimal | None = None,
user_groups: typing.Iterable[Any] | str = frozenset(),
parent_option_ids: typing.Iterable[str] | str = frozenset()
) -> None:

Creates a NumberRangeParameterOption object.

Required Arguments:

  • min_value: A string, int, or decimal.Decimal. This is the minimum selectable value for both the lower and upper selected values of the number range parameter
  • max_value: A string, int, or decimal.Decimal. This is the maximum selectable value for both the lower and upper selected values of the number range parameter
    • Must be greater than "min_value"

Optional Keyword Arguments:

  • increment: A string, int, or decimal.Decimal. This is the increment of selectable values. Default is 1
    • Must fit evenly between "min_value" and "max_value"
  • default_lower_value: A string, int, decimal.Decimal, or None. This is the default selected lower value. When None, the "min_value" is used. Default is None
    • Must be selectable based on "min_value", "max_value", and "increment"
  • default_upper_value: A string, int, decimal.Decimal, or None. This is the default selected upper value. When None, the "max_value" is used. Default is None
    • Must be selectable based on "min_value", "max_value", and "increment"
    • Must be greater than "default_lower_value"
  • user_groups:
    • A value or list of values (of any type) for the user attribute value(s) that this parameter option is visible for
    • The user attribute name is defined in the factory method of the NumberRangeParameter class associated with this parameter option
  • parent_options_ids:
    • A string or list of strings for the ID(s) of the parent parameter options that this parameter option is visible for
    • The parent parameter name is defined in the factory method of the NumberRangeParameter class associated with this parameter option