Skip to content

Commit

Permalink
Fix last occurences and reorder allowlist
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownPlatypus committed Nov 10, 2023
1 parent 58aa39c commit c24b7be
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
6 changes: 4 additions & 2 deletions django-stubs/contrib/gis/db/backends/postgis/operations.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ from typing import Any, Literal

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.db.backends.postgresql.operations import DatabaseOperations
from django.db.models import Func
from django.utils.functional import cached_property

BILATERAL: Literal["bilateral"]

Expand All @@ -16,8 +18,8 @@ class PostGISOperator(SpatialOperator):
class ST_Polygon(Func):
function: str
def __init__(self, expr: Any) -> None: ...
@property
def output_field(self) -> Any: ...
@cached_property
def output_field(self) -> GeometryField: ...

class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
name: str
Expand Down
10 changes: 5 additions & 5 deletions django-stubs/contrib/gis/db/models/functions.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, ClassVar

from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql.conversion import DistanceField
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models import BinaryField, BooleanField, FloatField, Func, IntegerField, TextField
from django.db.models import Transform as StandardTransform
Expand All @@ -18,8 +18,8 @@ class GeoFuncMixin:
class GeoFunc(GeoFuncMixin, Func): ...

class GeomOutputGeoFunc(GeoFunc):
@property
def output_field(self) -> Any: ...
@cached_property
def output_field(self) -> GeometryField: ...

class SQLiteDecimalToFloatMixin:
def as_sqlite(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...
Expand All @@ -30,8 +30,8 @@ class OracleToleranceMixin:

class Area(OracleToleranceMixin, GeoFunc):
arity: int
@property
def output_field(self) -> Any: ...
@cached_property
def output_field(self) -> AreaField: ...
def as_sqlite(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper, **extra_context: Any) -> _AsSqlType: ...

class Azimuth(GeoFunc):
Expand Down
11 changes: 7 additions & 4 deletions scripts/stubtest/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ django.contrib.gis.db.backends.mysql.operations.MySQLOperations.mariadb
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.mysql
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.select
django.contrib.gis.db.backends.mysql.operations.MySQLOperations.unsupported_functions
django.contrib.gis.db.backends.postgis.operations.ST_Polygon.output_field
django.contrib.gis.db.backends.spatialite.features.DatabaseFeatures.supports_area_geodetic
django.contrib.gis.db.backends.spatialite.operations.SpatiaLiteOperations.unsupported_functions
django.contrib.gis.db.models.DecimalField.validators
Expand All @@ -191,6 +192,10 @@ django.contrib.gis.db.models.ForeignObjectRel.related_model
django.contrib.gis.db.models.IntegerField.validators
django.contrib.gis.db.models.Lookup.contains_aggregate
django.contrib.gis.db.models.Lookup.contains_over_clause
django.contrib.gis.db.models.aggregates.GeoAggregate.output_field
django.contrib.gis.db.models.functions.Area.output_field
django.contrib.gis.db.models.functions.DistanceResultMixin.output_field
django.contrib.gis.db.models.functions.GeomOutputGeoFunc.output_field
django.contrib.gis.forms.BaseForm.changed_data
django.contrib.gis.forms.BaseFormSet.forms
django.contrib.gis.forms.BaseFormSet.management_form
Expand Down Expand Up @@ -305,9 +310,10 @@ django.db.models.Lookup.contains_aggregate
django.db.models.Lookup.contains_over_clause
django.db.models.expressions.BaseExpression.contains_aggregate
django.db.models.expressions.BaseExpression.contains_column_references
django.db.models.expressions.BaseExpression.contains_subquery
django.db.models.expressions.BaseExpression.contains_over_clause
django.db.models.expressions.BaseExpression.contains_subquery
django.db.models.expressions.BaseExpression.convert_value
django.db.models.expressions.BaseExpression.output_field
django.db.models.fields.DecimalField.validators
django.db.models.fields.Field.cached_col
django.db.models.fields.Field.validators
Expand Down Expand Up @@ -390,6 +396,3 @@ django.urls.resolvers.URLPattern.lookup_str
django.urls.resolvers.URLResolver.url_patterns
django.urls.resolvers.URLResolver.urlconf_module
django.utils.connection.BaseConnectionHandler.settings
django.contrib.gis.db.models.aggregates.GeoAggregate.output_field
django.contrib.gis.db.models.functions.DistanceResultMixin.output_field
django.db.models.expressions.BaseExpression.output_field

0 comments on commit c24b7be

Please sign in to comment.