gws.plugin.model_value.expression

Expression value.

This value is computed by evaluating a python expression.

The following variables are provided to the expression:

  • app - the Application object

  • user - current user

  • project - current project

  • feature - feature this value is evaluated for

  • mc - ModelContext object

The following modules are available:

Additional modules can be imported by specifying them in the imports configuration option. This should be a list of module names to import, e.g. ["math", "os"].

Source code: gws.plugin.model_value.expression

Package Contents

class gws.plugin.model_value.expression.Config

Bases: gws.base.model.value.Config

Expression-based value. (added in 8.1)

expression: str

Python expression to evaluate.

imports: list[str] | None

List of additional modules to import. (added in 8.2)

class gws.plugin.model_value.expression.Object

Bases: gws.base.model.value.Object

expression: str
imports: list[str]
compute(field, feature, mc)
configure()