reenact.reenact.forms#
Forms for ReEnAct dashboard.
CapacitiesForm
#
Bases: Form
Form to create sliders from configuration for capacities used in MyPlan.
Attributes:
| Name | Type | Description |
|---|---|---|
template_name_div |
str
|
Path to the template used for rendering the form. |
__init__(data=None, **kwargs)
#
Initialize the form and dynamically create fields based on SLIDERS configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Data to bind to the form. |
None
|
|
**kwargs
|
Additional keyword arguments for Form initialization. |
{}
|
get_max_value(slider, data)
#
Get max value for slider based on marsh value in data dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slider
|
SliderConfig
|
The slider configuration object. |
required |
data
|
dict | None
|
Data dictionary containing marsh value. |
required |
Returns:
| Type | Description |
|---|---|
int | float
|
int | float: The calculated maximum value for the slider. |