swissvotes.fields.metadata ========================== .. py:module:: swissvotes.fields.metadata Classes ------- .. autoapisummary:: swissvotes.fields.metadata.SwissvoteMetadataField Module Contents --------------- .. py:class:: SwissvoteMetadataField(label: str | None = None, validators: onegov.form.types.Validators[onegov.form.types.FormT, Self] | None = None, filters: collections.abc.Sequence[onegov.form.types.Filter] = (), description: str = '', id: str | None = None, default: collections.abc.Sequence[onegov.core.types.FileDict] = (), widget: onegov.form.types.Widget[Self] | 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) Bases: :py:obj:`onegov.form.fields.UploadField` An upload field expecting Swissvotes metadata (XLSX). .. py:attribute:: data :type: dict[decimal.Decimal, dict[str, Any]] .. py:method:: post_validate(form: wtforms.form.BaseForm, validation_stopped: bool) -> None Make sure the given XLSX is valid (all expected columns are present all cells contain reasonable values). Converts the XLSX to a list of metadata dictionaries objects, available as ``data``.