gis.forms.fields
Classes
Represents a single pair of coordinates with optional zoom and |
|
Provides utility functions for all renderers. |
Module Contents
- class gis.forms.fields.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)[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 theDataRequired
validator has to be chosen.- process_data(value: object) None [source]
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.
- Parameters:
value – The python object containing the value to process.
- class gis.forms.fields.CoordinatesFieldRenderer[source]
Bases:
onegov.form.display.BaseRenderer
Provides utility functions for all renderers.
- __call__(field: CoordinatesField) markupsafe.Markup [source]