gis.forms.fields

Classes

CoordinatesField

Represents a single pair of coordinates with optional zoom and

CoordinatesFieldRenderer

Module Contents

class gis.forms.fields.CoordinatesField(label: str | None = None, validators: onegov.form.types.Validators[onegov.form.types.FormT, Self] | None = None, filters: collections.abc.Sequence[wtforms.fields.core._Filter] = (), description: str = '', id: str | None = None, default: onegov.gis.models.coordinates.AnyCoordinates | collections.abc.Callable[[], onegov.gis.models.coordinates.AnyCoordinates] | None = None, widget: wtforms.fields.core._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)[source]

Bases: wtforms.fields.StringField

Represents a single pair of coordinates with optional zoom and marker icon/color selection.

In the browser and during transit the point is stored as a base64 encoded json string on a simple input field. For example:

eydsYXQnOiA4LjMwNTc2ODY5MTczODc5LCAnbG.. (and so on)

=>

{'lon': 8.30576869173879, 'lat': 47.05183585, 'zoom': 10}

For verification: This points to the Seantis office in Lucerne.

For convenience, the coordinates are accessible with the onegov.gis.models.coordinates.Coordinates class when ‘data’ is used.

Note that this field doesn’t work with the InputRequired validator. Instead the DataRequired validator has to be chosen.

data: onegov.gis.models.coordinates.AnyCoordinates[source]
widget: wtforms.fields.core._Widget[Self][source]
_value() → str[source]
process_data(value: object) → None[source]
populate_obj(obj: object, name: str) → None[source]
process_formdata(valuelist: list[onegov.form.types.RawFormValue]) → None[source]
class gis.forms.fields.CoordinatesFieldRenderer[source]

Bases: onegov.form.display.BaseRenderer

__call__(field: CoordinatesField) → markupsafe.Markup[source]