module documentation

The dataexplorer.forms module defines the relatively complex form that is used for querying the database later.

It also implements some custom form elements, like ThreeWayToggle and ThreeWayToggleWidget that represent the custom logic and appearance of a three-way toggle button respectively, which appears numerous times in the Dashboard interface.

Finally, a custom MultipleChoice field of somewhat unnecessary complexity is implemented here that allows us to select the institutions from which the ptients should be included via check boxes with the institution logo on it.

Class DashboardForm Form for querying the database.
Class DatasetModelChoiceIndexer Custom class with which one can access additional information from the model that is chosen by the DatasetMultipleChoiceField.
Class DatasetMultipleChoiceField Customize label description and add method that returns the logo URL for Datasets. The implementation is inspired by how the choices are implemented. But since some other functionality depends on how those choices are implemented, it cannot be changed easily.
Class ThreeWayToggle A toggle switch than can be in three different states: Positive/True, unkown/None and negative/False.
Class ThreeWayToggleWidget Widget that renders the three-way toggle button and allows to set the attributes of the individual inputs (radio buttons) as option_attrs as well as the attributes of the container as attrs.
Function trio_to_bool Transform -1, 0, and +1 to False, None and True respectively.
Variable logger Undocumented
def trio_to_bool(value):

Transform -1, 0, and +1 to False, None and True respectively.

Any other values are simply passed through unchanged. This is used to map the values of the three-way toggle buttons to its boolean representation.

Parameters
value:intUndocumented
logger =

Undocumented