swissvotes.fields.policy_area
Classes
dict() -> new empty dictionary |
|
The widget for the React Dropdown Tree. |
|
A select field with React Dropdown Tree support. |
Module Contents
- 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: str | None = None, validators: onegov.form.types.Validators[onegov.form.types.FormT, Self] | None = None, *, tree: list[PolicyAreaTreeNode] = ..., filters: collections.abc.Sequence[onegov.form.types.Filter] = (), description: str = '', id: str | None = None, default: object | None = None, widget: onegov.form.types.Widget[Self] | None = None, option_widget: onegov.form.types.Widget[wtforms.fields.choices.SelectFieldBase._Option] | None = None, render_kw: dict[str, Any] | None = None, name: str | None = None, _form: wtforms.form.BaseForm | None = None, _prefix: str = '', _translations: wtforms.meta._SupportsGettextAndNgettext | None = None, _meta: wtforms.meta.DefaultMeta | None = None, fieldset: str | None = None, depends_on: collections.abc.Sequence[Any] | None = None, pricing: onegov.form.types.PricingRules | None = None)[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.