Skip to main content
ContextArgs is the class type of the sqrl argument for the context configuration function (i.e. the main function in the pyconfigs/context.py file), which runs every time an API request is made. The class can be imported from the squirrels.arguments or squirrels module.

Properties

str
Path to the Squirrels project directory.
dict[str, Any]
A copy of project variables as a dictionary.
dict[str, str]
A copy of environment variables as a dictionary.
AbstractUser
The current authenticated user.
dict[str, Parameter]
A copy of the parameters dictionary.
dict[str, str]
A copy of the configurables dictionary (values set by application).

Methods

set_placeholder()

Sets a placeholder value for use in SQL queries.
str
An empty string (because this function is also available to call from Jinja).

param_exists()

Checks whether a given parameter exists and contains options.
bool
True if the parameter exists and is enabled, False otherwise.