Gvz API
This module interacts with an external GVZ (Gemeindeverzeichnis) API to automatically import coordinates and region aliases.
Apps
Configuration of GVZ API app
- class integreat_cms.gvz_api.apps.GvzApiConfig(app_name, app_module)[source]
Bases:
AppConfig
GVZ API config inheriting the django AppConfig
- classmethod create(entry)[source]
Factory that creates an app config from an entry in INSTALLED_APPS.
- get_model(model_name, require_ready=True)[source]
Return the model with the given case-insensitive model_name.
Raise LookupError if no model exists with this name.
- get_models(include_auto_created=False, include_swapped=False)[source]
Return an iterable of models.
By default, the following models aren’t included:
auto-created models for many-to-many relations without an explicit intermediate table,
models that have been swapped out.
Set the corresponding keyword argument to True to include such models. Keyword arguments aren’t documented; they’re a private API.
Utils
Helper classes for Gemeindeverzeichnis API
- class integreat_cms.gvz_api.utils.GvzApiWrapper[source]
Bases:
object
Class that wraps around the GVZ (Gemeindeverzeichnis) API
- best_match(region_name: str | None, division_type: str | None) dict[str, Any] | None [source]
Tries to find the correct region id (single search hit)
- Parameters:
region_name (str | None) – name of a region (city name, county name, etc)
division_type (str | None) – administrative division type of region (choices:
administrative_division
)
- Returns:
JSON search results defined in the GVZ API
- Return type:
- get_child_coordinates(child_urls: list) dict [source]
Recursively get coordinates for list of children
- class integreat_cms.gvz_api.utils.GvzRegion(region_ags: str | None = None, region_name: str | None = None, region_type: str | None = None)[source]
Bases:
object
Represents a region in the GVZ, initial values will be retrieved from API on initialization.
- Parameters:
region_ags (str | None) – official ID for a region, i.e. Gemeindeschlüssel, defaults to
None
region_name (str | None) – name of a region (city name, county name, etc), defaults to
None
division_type – administrative division type of region (choices:
administrative_division
), defaults toNone
region_type (str | None)