swissvotes.fields.policy_area
¶
Module Contents¶
Classes¶
dict() -> new empty dictionary |
|
The widget for the React Dropdown Tree. |
|
A select field with React Dropdown Tree support. |
- class swissvotes.fields.policy_area.PolicyAreaTreeNode[source]¶
Bases:
TypedDict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
- children: list[PolicyAreaTreeNode][source]¶
- class swissvotes.fields.policy_area.PolicyAreaWidget(multiple=False)[source]¶
Bases:
wtforms.widgets.Select
The widget for the React Dropdown Tree.
- __call__(field: PolicyAreaField, **kwargs: object) markupsafe.Markup [source]¶
- class swissvotes.fields.policy_area.PolicyAreaField(label=None, validators=None, coerce=str, choices=None, validate_choice=True, **kwargs)[source]¶
Bases:
wtforms.fields.SelectMultipleField
A select field with React Dropdown Tree support.
- property tree: list[PolicyAreaTreeNode][source]¶
Returns the tree data and automatically preselects the selected select options.