gis.forms.fields ================ .. py:module:: gis.forms.fields Classes ------- .. autoapisummary:: gis.forms.fields.CoordinatesField gis.forms.fields.CoordinatesFieldRenderer Module Contents --------------- .. py:class:: CoordinatesField(label: str | None = None, validators: Validators[_FormT, Self] | None = None, filters: Sequence[_Filter] = (), description: str = '', id: str | None = None, default: AnyCoordinates | Callable[[], AnyCoordinates] | None = None, widget: _Widget[Self] | None = None, render_kw: dict[str, Any] | None = None, name: str | None = None, _form: BaseForm | None = None, _prefix: str = '', _translations: _SupportsGettextAndNgettext | None = None, _meta: DefaultMeta | None = None, *, fieldset: str | None = None, depends_on: Sequence[Any] | None = None, pricing: PricingRules | None = None) Bases: :py:obj:`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 :class:`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. .. py:attribute:: data :type: onegov.gis.models.coordinates.AnyCoordinates .. py:attribute:: widget :type: _Widget[Self] .. py:method:: _value() -> str .. py:method:: process_data(value: object) -> None Process the Python data applied to this field and store the result. This will be called during form construction by the form's `kwargs` or `obj` argument. :param value: The python object containing the value to process. .. py:method:: populate_obj(obj: object, name: str) -> None Populates `obj.` with the field's data. :note: This is a destructive operation. If `obj.` already exists, it will be overridden. Use with caution. .. py:method:: process_formdata(valuelist: list[onegov.form.types.RawFormValue]) -> None Process data received over the wire from a form. This will be called during form construction with data supplied through the `formdata` argument. :param valuelist: A list of strings to process. .. py:class:: CoordinatesFieldRenderer Bases: :py:obj:`onegov.form.display.BaseRenderer` Provides utility functions for all renderers. .. py:method:: __call__(field: CoordinatesField) -> markupsafe.Markup