Skip to main content
Data source class for populating text parameter options from a database table or query. This class can be imported from the squirrels.data_sources or the squirrels module.

Constructor

Creates a TextDataSource object.

Examples

A TextDataSource object is created in the pyconfigs/parameters.py file. It must be created in a function decorated with the create_from_source factory method from TextParameter.

Usage example in parameters.py

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

Using a table from a specific connection

This example uses a table called “default_values” from the “config_db” connection.
The connection must either be defined in squirrels.yml or the connections.py file.

Using seeds as the data source

This example uses a seed file called “text_defaults”.

Enabling cascading effects with a parent parameter

In this example, the default text value is determined by the selected value of another parameter called “template_type”.