1
1
from typing import Any
2
2
3
+ from django .db .backends .base .base import BaseDatabaseWrapper
3
4
from django .db .models import Func
4
5
from django .db .models import Transform as StandardTransform
6
+ from django .db .models .sql .compiler import SQLCompiler , _AsSqlType
5
7
6
8
NUMERIC_TYPES : Any
7
9
@@ -17,17 +19,17 @@ class GeomOutputGeoFunc(GeoFunc):
17
19
def output_field (self ) -> Any : ...
18
20
19
21
class SQLiteDecimalToFloatMixin :
20
- def as_sqlite (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
22
+ def as_sqlite (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
21
23
22
24
class OracleToleranceMixin :
23
25
tolerance : float
24
- def as_oracle (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
26
+ def as_oracle (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
25
27
26
28
class Area (OracleToleranceMixin , GeoFunc ):
27
29
arity : int
28
30
@property
29
31
def output_field (self ) -> Any : ...
30
- def as_sqlite (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
32
+ def as_sqlite (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
31
33
32
34
class Azimuth (GeoFunc ):
33
35
output_field : Any
@@ -39,13 +41,13 @@ class AsGeoJSON(GeoFunc):
39
41
def __init__ (
40
42
self , expression : Any , bbox : bool = ..., crs : bool = ..., precision : int = ..., ** extra : Any
41
43
) -> None : ...
42
- def as_oracle (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
44
+ def as_oracle (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
43
45
44
46
class AsGML (GeoFunc ):
45
47
geom_param_pos : Any
46
48
output_field : Any
47
49
def __init__ (self , expression : Any , version : int = ..., precision : int = ..., ** extra : Any ) -> None : ...
48
- def as_oracle (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
50
+ def as_oracle (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
49
51
50
52
class AsKML (GeoFunc ):
51
53
output_field : Any
@@ -65,7 +67,7 @@ class AsWKT(GeoFunc):
65
67
66
68
class BoundingCircle (OracleToleranceMixin , GeomOutputGeoFunc ):
67
69
def __init__ (self , expression : Any , num_seg : int = ..., ** extra : Any ) -> None : ...
68
- def as_oracle (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
70
+ def as_oracle (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
69
71
70
72
class Centroid (OracleToleranceMixin , GeomOutputGeoFunc ):
71
73
arity : int
@@ -83,8 +85,10 @@ class Distance(DistanceResultMixin, OracleToleranceMixin, GeoFunc):
83
85
geom_param_pos : Any
84
86
spheroid : Any
85
87
def __init__ (self , expr1 : Any , expr2 : Any , spheroid : Any | None = ..., ** extra : Any ) -> None : ...
86
- def as_postgresql (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
87
- def as_sqlite (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
88
+ def as_postgresql (
89
+ self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any
90
+ ) -> _AsSqlType : ...
91
+ def as_sqlite (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
88
92
89
93
class Envelope (GeomOutputGeoFunc ):
90
94
arity : int
@@ -95,7 +99,7 @@ class ForcePolygonCW(GeomOutputGeoFunc):
95
99
class GeoHash (GeoFunc ):
96
100
output_field : Any
97
101
def __init__ (self , expression : Any , precision : Any | None = ..., ** extra : Any ) -> None : ...
98
- def as_mysql (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
102
+ def as_mysql (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
99
103
100
104
class GeometryDistance (GeoFunc ):
101
105
output_field : Any
@@ -111,13 +115,15 @@ class Intersection(OracleToleranceMixin, GeomOutputGeoFunc):
111
115
class IsValid (OracleToleranceMixin , GeoFuncMixin , StandardTransform ):
112
116
lookup_name : str
113
117
output_field : Any
114
- def as_oracle (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
118
+ def as_oracle (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
115
119
116
120
class Length (DistanceResultMixin , OracleToleranceMixin , GeoFunc ):
117
121
spheroid : Any
118
122
def __init__ (self , expr1 : Any , spheroid : bool = ..., ** extra : Any ) -> None : ...
119
- def as_postgresql (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
120
- def as_sqlite (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
123
+ def as_postgresql (
124
+ self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any
125
+ ) -> _AsSqlType : ...
126
+ def as_sqlite (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
121
127
122
128
class LineLocatePoint (GeoFunc ):
123
129
output_field : Any
@@ -140,8 +146,10 @@ class NumPoints(GeoFunc):
140
146
141
147
class Perimeter (DistanceResultMixin , OracleToleranceMixin , GeoFunc ):
142
148
arity : int
143
- def as_postgresql (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
144
- def as_sqlite (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
149
+ def as_postgresql (
150
+ self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any
151
+ ) -> _AsSqlType : ...
152
+ def as_sqlite (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
145
153
146
154
class PointOnSurface (OracleToleranceMixin , GeomOutputGeoFunc ):
147
155
arity : int
@@ -163,7 +171,7 @@ class Transform(GeomOutputGeoFunc):
163
171
def __init__ (self , expression : Any , srid : Any , ** extra : Any ) -> None : ...
164
172
165
173
class Translate (Scale ):
166
- def as_sqlite (self , compiler : Any , connection : Any , ** extra_context : Any ) -> Any : ...
174
+ def as_sqlite (self , compiler : SQLCompiler , connection : BaseDatabaseWrapper , ** extra_context : Any ) -> _AsSqlType : ...
167
175
168
176
class Union (OracleToleranceMixin , GeomOutputGeoFunc ):
169
177
arity : int
0 commit comments