mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-20 02:41:16 +08:00
* Annotate the return type of as_sql for SpatialOperator. Its subclasses inherits the type annotation from `SpatialOperator`, so copying `as_sql` over is unnecessary. Signed-off-by: Zixuan James Li <p359101898@gmail.com> * Remove unnecessary as_sql definition. `Query` inherits `as_sql` from `BaseExpression`, `GISLookup` inherits `as_sql` from `Lookup`, and `BuiltinLookup` inherits `as_sql` from `Lookup[_T]`. None is required to be redefined. Signed-off-by: Zixuan James Li <p359101898@gmail.com> * Unify return types of as_sql and friends as _AsSqlType. `Tuple[str, _ParamsT]`, `Tuple[str, List[Union[str, int]]]` and other similar type annotations are all replaced with the `_AsSqlType` alias. Any as_sql definition that annotate the return type as `Any` is also updated to use `_AsSqlType`. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
43 lines
1.5 KiB
Python
43 lines
1.5 KiB
Python
from typing import Any
|
|
|
|
from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations as BaseSpatialOperations
|
|
from django.contrib.gis.db.backends.utils import SpatialOperator as SpatialOperator
|
|
from django.db.backends.oracle.operations import DatabaseOperations as DatabaseOperations
|
|
|
|
DEFAULT_TOLERANCE: str
|
|
|
|
class SDOOperator(SpatialOperator):
|
|
sql_template: str = ...
|
|
|
|
class SDODWithin(SpatialOperator):
|
|
sql_template: str = ...
|
|
|
|
class SDODisjoint(SpatialOperator):
|
|
sql_template: Any = ...
|
|
|
|
class SDORelate(SpatialOperator):
|
|
sql_template: str = ...
|
|
def check_relate_argument(self, arg: Any) -> None: ...
|
|
|
|
class OracleOperations(BaseSpatialOperations, DatabaseOperations):
|
|
name: str = ...
|
|
oracle: bool = ...
|
|
disallowed_aggregates: Any = ...
|
|
Adapter: Any = ...
|
|
extent: str = ...
|
|
unionagg: str = ...
|
|
function_names: Any = ...
|
|
select: str = ...
|
|
gis_operators: Any = ...
|
|
unsupported_functions: Any = ...
|
|
def geo_quote_name(self, name: Any): ...
|
|
def geo_db_type(self, f: Any): ...
|
|
def get_distance(self, f: Any, value: Any, lookup_type: Any): ...
|
|
def get_geom_placeholder(self, f: Any, value: Any, compiler: Any): ...
|
|
def spatial_aggregate_name(self, agg_name: Any): ...
|
|
def geometry_columns(self): ...
|
|
def spatial_ref_sys(self): ...
|
|
def modify_insert_params(self, placeholder: Any, params: Any): ...
|
|
def get_geometry_converter(self, expression: Any): ...
|
|
def get_area_att_for_field(self, field: Any): ...
|