Skip to main content
Parameter option for text 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 TextParameterOption object. Typically used in pyconfigs/parameters.py.

Examples

A TextParameterOption 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 TextParameter.

Usage example in parameters.py

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

Setting up cascading parameters with varying default text

This example shows how to create text options that change their default values based on the selection of a parent parameter (e.g., different report types with different default search terms).

Restricting default text by user groups

This example shows how to provide different default text values 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 provide different default text values as well. To do so, the user_attribute argument must be prefixed with custom_fields..