diff --git a/django-stubs/contrib/gis/db/backends/postgis/operations.pyi b/django-stubs/contrib/gis/db/backends/postgis/operations.pyi index eee045678..0f2c95b77 100644 --- a/django-stubs/contrib/gis/db/backends/postgis/operations.pyi +++ b/django-stubs/contrib/gis/db/backends/postgis/operations.pyi @@ -1,8 +1,9 @@ -from typing import Any, Literal +from typing import Any, Literal, MutableMapping from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models.fields import GeometryField +from django.contrib.gis.db.models.lookups import GISLookup from django.db.backends.postgresql.operations import DatabaseOperations from django.db.models import Func from django.utils.functional import cached_property @@ -14,6 +15,11 @@ class PostGISOperator(SpatialOperator): raster: bool | Literal["bilateral"] def __init__(self, geography: bool = ..., raster: bool | Literal["bilateral"] = ..., **kwargs: Any) -> None: ... def check_raster(self, lookup: Any, template_params: Any) -> Any: ... + def check_geography( + self, + lookup: GISLookup, + template_params: MutableMapping[str, Any], + ) -> MutableMapping[str, Any]: ... class ST_Polygon(Func): function: str diff --git a/django-stubs/contrib/gis/db/backends/utils.pyi b/django-stubs/contrib/gis/db/backends/utils.pyi index 54e15f709..e83aca1c9 100644 --- a/django-stubs/contrib/gis/db/backends/utils.pyi +++ b/django-stubs/contrib/gis/db/backends/utils.pyi @@ -1,5 +1,5 @@ -from collections.abc import Mapping, Sequence -from typing import Any +from collections.abc import Sequence +from typing import Any, MutableMapping from django.contrib.gis.db.models.lookups import GISLookup from django.db.backends.base.base import BaseDatabaseWrapper @@ -16,6 +16,6 @@ class SpatialOperator: self, connection: BaseDatabaseWrapper, lookup: GISLookup, - template_params: Mapping[str, Any], + template_params: MutableMapping[str, Any], sql_params: Sequence[Any], ) -> _AsSqlType: ... diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index 104ad8f85..4e79d3276 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -216,7 +216,6 @@ django.contrib.gis.db.backends.postgis.features.DatabaseFeatures.empty_intersect django.contrib.gis.db.backends.postgis.features.DatabaseFeatures.supports_geography django.contrib.gis.db.backends.postgis.operations.PostGISOperations.convert_extent django.contrib.gis.db.backends.postgis.operations.PostGISOperations.convert_extent3d -django.contrib.gis.db.backends.postgis.operations.PostGISOperator.check_geography django.contrib.gis.db.backends.postgis.schema.PostGISSchemaEditor.rast_index_template django.contrib.gis.db.backends.spatialite.base.DatabaseWrapper.ops django.contrib.gis.db.backends.spatialite.features.DatabaseFeatures.can_alter_geometry_field