Skip to main content
Parameter option for number range parameters that can vary based on selection of another parameter. This class can be imported from the squirrels.parameter_options or the squirrels module.

Constructor

Creates a NumberRangeParameterOption object. Typically used in pyconfigs/parameters.py.

Examples

A NumberRangeParameterOption object is created in the pyconfigs/parameters.py file. It must be created in a function decorated with the create_with_options factory method from NumberRangeParameter.

Usage example in parameters.py

In addition, the following are some additional examples for creating a NumberRangeParameterOption object.

Setting up cascading parameters with varying number ranges

This example shows how to create number range options that change their constraints based on the selection of a parent parameter (e.g., different product categories with different price ranges).

Restricting value ranges by user groups

This example shows how to provide different value range constraints based on user access levels using the user_groups parameter.
If custom user fields are defined in pyconfigs/user.py, then they can be used to restrict value range constraints as well. To do so, the user_attribute argument must be prefixed with custom_fields..