Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0: Update django.contrib.gis.db.backends.postgis.operations #2138

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion django-stubs/contrib/gis/db/backends/postgis/operations.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions django-stubs/contrib/gis/db/backends/utils.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: ...
1 change: 0 additions & 1 deletion scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading