Output field
note
For larger sections of text in the parametrization, see Text
An OutputField
can be used to display a textual or numeric value to the user
within a parametrization that cannot be modified by the user. The value
must be set in the parametrization and can
be a static value (str
, float
), or obtained dynamically using a Lookup
or a callback function, similar to setting
the visibility when hiding a field.
import viktor as vkt
def sum_x_y(params, **kwargs):
return params.param_x + params.param_y
class Parametrization(vkt.Parametrization):
param_x = vkt.NumberField('X')
param_y = vkt.NumberField('Y')
not_in_params = vkt.OutputField('X + Y', value=sum_x_y)
note
The value of the OutputField
field is not included in the params.