mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Continue to attack E302 violations
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from cx_Oracle import CLOB
|
||||
from django.contrib.gis.db.backends.adapter import WKTAdapter
|
||||
|
||||
|
||||
class OracleSpatialAdapter(WKTAdapter):
|
||||
input_size = CLOB
|
||||
|
||||
@@ -3,23 +3,30 @@ from django.db.backends.oracle import compiler
|
||||
|
||||
SQLCompiler = compiler.SQLCompiler
|
||||
|
||||
|
||||
class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler):
|
||||
pass
|
||||
|
||||
|
||||
class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler):
|
||||
pass
|
||||
|
||||
|
||||
class SQLDeleteCompiler(compiler.SQLDeleteCompiler, GeoSQLCompiler):
|
||||
pass
|
||||
|
||||
|
||||
class SQLUpdateCompiler(compiler.SQLUpdateCompiler, GeoSQLCompiler):
|
||||
pass
|
||||
|
||||
|
||||
class SQLAggregateCompiler(compiler.SQLAggregateCompiler, GeoSQLCompiler):
|
||||
pass
|
||||
|
||||
|
||||
class SQLDateCompiler(compiler.SQLDateCompiler, GeoSQLCompiler):
|
||||
pass
|
||||
|
||||
|
||||
class SQLDateTimeCompiler(compiler.SQLDateTimeCompiler, GeoSQLCompiler):
|
||||
pass
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from django.db.backends.oracle.creation import DatabaseCreation
|
||||
from django.db.backends.utils import truncate_name
|
||||
|
||||
|
||||
class OracleCreation(DatabaseCreation):
|
||||
|
||||
def sql_indexes_for_field(self, model, f, style):
|
||||
|
||||
@@ -3,6 +3,7 @@ import sys
|
||||
from django.db.backends.oracle.introspection import DatabaseIntrospection
|
||||
from django.utils import six
|
||||
|
||||
|
||||
class OracleIntrospection(DatabaseIntrospection):
|
||||
# Associating any OBJECTVAR instances with GeometryField. Of course,
|
||||
# this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY,
|
||||
|
||||
@@ -11,6 +11,7 @@ from django.contrib.gis.db import models
|
||||
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class GeometryColumns(models.Model):
|
||||
"Maps to the Oracle USER_SDO_GEOM_METADATA table."
|
||||
@@ -42,6 +43,7 @@ class GeometryColumns(models.Model):
|
||||
def __str__(self):
|
||||
return '%s - %s (SRID: %s)' % (self.table_name, self.column_name, self.srid)
|
||||
|
||||
|
||||
class SpatialRefSys(models.Model, SpatialRefSysMixin):
|
||||
"Maps to the Oracle MDSYS.CS_SRS table."
|
||||
cs_name = models.CharField(max_length=68)
|
||||
|
||||
@@ -28,6 +28,7 @@ class SDOOperation(SpatialFunction):
|
||||
kwargs.setdefault('result', 'TRUE')
|
||||
super(SDOOperation, self).__init__(func, **kwargs)
|
||||
|
||||
|
||||
class SDODistance(SpatialFunction):
|
||||
"Class for Distance queries."
|
||||
sql_template = ('%(function)s(%(geo_col)s, %(geometry)s, %(tolerance)s) '
|
||||
@@ -39,6 +40,7 @@ class SDODistance(SpatialFunction):
|
||||
tolerance=tolerance,
|
||||
operator=op, result='%s')
|
||||
|
||||
|
||||
class SDODWithin(SpatialFunction):
|
||||
dwithin_func = 'SDO_WITHIN_DISTANCE'
|
||||
sql_template = "%(function)s(%(geo_col)s, %(geometry)s, %%s) = 'TRUE'"
|
||||
@@ -46,6 +48,7 @@ class SDODWithin(SpatialFunction):
|
||||
def __init__(self):
|
||||
super(SDODWithin, self).__init__(self.dwithin_func)
|
||||
|
||||
|
||||
class SDOGeomRelate(SpatialFunction):
|
||||
"Class for using SDO_GEOM.RELATE."
|
||||
relate_func = 'SDO_GEOM.RELATE'
|
||||
@@ -58,6 +61,7 @@ class SDOGeomRelate(SpatialFunction):
|
||||
super(SDOGeomRelate, self).__init__(self.relate_func, operator='=',
|
||||
mask=mask, tolerance=tolerance)
|
||||
|
||||
|
||||
class SDORelate(SpatialFunction):
|
||||
"Class for using SDO_RELATE."
|
||||
masks = 'TOUCH|OVERLAPBDYDISJOINT|OVERLAPBDYINTERSECT|EQUAL|INSIDE|COVEREDBY|CONTAINS|COVERS|ANYINTERACT|ON'
|
||||
@@ -73,6 +77,7 @@ class SDORelate(SpatialFunction):
|
||||
# Valid distance types and substitutions
|
||||
dtypes = (Decimal, Distance, float) + six.integer_types
|
||||
|
||||
|
||||
class OracleOperations(DatabaseOperations, BaseSpatialOperations):
|
||||
compiler_module = "django.contrib.gis.db.backends.oracle.compiler"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user