Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
67bcae1e
Kaydet (Commit)
67bcae1e
authored
Ock 14, 2015
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved check_aggregate_support to BaseSpatialOperations
üst
9801d419
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
21 deletions
+11
-21
operations.py
django/contrib/gis/db/backends/base/operations.py
+5
-0
operations.py
django/contrib/gis/db/backends/mysql/operations.py
+1
-1
operations.py
django/contrib/gis/db/backends/oracle/operations.py
+1
-1
operations.py
django/contrib/gis/db/backends/postgis/operations.py
+1
-9
operations.py
django/contrib/gis/db/backends/spatialite/operations.py
+1
-10
aggregates.py
django/contrib/gis/db/models/aggregates.py
+1
-0
features.py
django/db/backends/base/features.py
+1
-0
No files found.
django/contrib/gis/db/backends/base/operations.py
Dosyayı görüntüle @
67bcae1e
...
...
@@ -102,6 +102,11 @@ class BaseSpatialOperations(object):
"""
raise
NotImplementedError
(
'subclasses of BaseSpatialOperations must provide a geo_db_placeholder() method'
)
def
check_aggregate_support
(
self
,
aggregate
):
if
aggregate
.
contains_aggregate
==
'gis'
:
return
aggregate
.
name
in
self
.
valid_aggregates
return
super
(
BaseSpatialOperations
,
self
)
.
check_aggregate_support
(
aggregate
)
# Spatial SQL Construction
def
spatial_aggregate_sql
(
self
,
agg
):
raise
NotImplementedError
(
'Aggregate support not implemented for this spatial backend.'
)
...
...
django/contrib/gis/db/backends/mysql/operations.py
Dosyayı görüntüle @
67bcae1e
...
...
@@ -4,7 +4,7 @@ from django.contrib.gis.db.backends.utils import SpatialOperator
from
django.db.backends.mysql.operations
import
DatabaseOperations
class
MySQLOperations
(
DatabaseOperations
,
BaseSpatial
Operations
):
class
MySQLOperations
(
BaseSpatialOperations
,
Database
Operations
):
mysql
=
True
name
=
'mysql'
...
...
django/contrib/gis/db/backends/oracle/operations.py
Dosyayı görüntüle @
67bcae1e
...
...
@@ -52,7 +52,7 @@ class SDORelate(SpatialOperator):
return
super
(
SDORelate
,
self
)
.
as_sql
(
connection
,
lookup
,
template_params
,
sql_params
)
class
OracleOperations
(
DatabaseOperations
,
BaseSpatial
Operations
):
class
OracleOperations
(
BaseSpatialOperations
,
Database
Operations
):
name
=
'oracle'
oracle
=
True
...
...
django/contrib/gis/db/backends/postgis/operations.py
Dosyayı görüntüle @
67bcae1e
...
...
@@ -43,7 +43,7 @@ class PostGISDistanceOperator(PostGISOperator):
return
super
(
PostGISDistanceOperator
,
self
)
.
as_sql
(
connection
,
lookup
,
template_params
,
sql_params
)
class
PostGISOperations
(
DatabaseOperations
,
BaseSpatial
Operations
):
class
PostGISOperations
(
BaseSpatialOperations
,
Database
Operations
):
name
=
'postgis'
postgis
=
True
geography
=
True
...
...
@@ -179,14 +179,6 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
version
=
vtup
[
1
:]
return
version
def
check_aggregate_support
(
self
,
aggregate
):
"""
Checks if the given aggregate name is supported (that is, if it's
in `self.valid_aggregates`).
"""
agg_name
=
aggregate
.
__class__
.
__name__
return
agg_name
in
self
.
valid_aggregates
def
convert_extent
(
self
,
box
,
srid
):
"""
Returns a 4-tuple extent for the `Extent` aggregate by converting
...
...
django/contrib/gis/db/backends/spatialite/operations.py
Dosyayı görüntüle @
67bcae1e
...
...
@@ -13,7 +13,7 @@ from django.utils import six
from
django.utils.functional
import
cached_property
class
SpatiaLiteOperations
(
DatabaseOperations
,
BaseSpatial
Operations
):
class
SpatiaLiteOperations
(
BaseSpatialOperations
,
Database
Operations
):
name
=
'spatialite'
spatialite
=
True
version_regex
=
re
.
compile
(
r'^(?P<major>\d)\.(?P<minor1>\d)\.(?P<minor2>\d+)'
)
...
...
@@ -121,15 +121,6 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
def
geojson
(
self
):
return
'AsGeoJSON'
if
self
.
spatial_version
>=
(
3
,
0
,
0
)
else
None
def
check_aggregate_support
(
self
,
aggregate
):
"""
Checks if the given aggregate name is supported (that is, if it's
in `self.valid_aggregates`).
"""
super
(
SpatiaLiteOperations
,
self
)
.
check_aggregate_support
(
aggregate
)
agg_name
=
aggregate
.
__class__
.
__name__
return
agg_name
in
self
.
valid_aggregates
def
convert_extent
(
self
,
box
,
srid
):
"""
Convert the polygon data received from Spatialite to min/max values.
...
...
django/contrib/gis/db/models/aggregates.py
Dosyayı görüntüle @
67bcae1e
...
...
@@ -7,6 +7,7 @@ __all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union']
class
GeoAggregate
(
Aggregate
):
template
=
None
function
=
None
contains_aggregate
=
'gis'
is_extent
=
False
def
as_sql
(
self
,
compiler
,
connection
):
...
...
django/db/backends/base/features.py
Dosyayı görüntüle @
67bcae1e
...
...
@@ -224,6 +224,7 @@ class BaseDatabaseFeatures(object):
def
supports_stddev
(
self
):
"""Confirm support for STDDEV and related stats functions."""
class
StdDevPop
(
object
):
contains_aggregate
=
True
sql_function
=
'STDDEV_POP'
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment