Fixed Oracle GIS gml() test failure introduced by e910340; refs #18757.
This commit is contained in:
parent
c9a53035d6
commit
c6fd1e904c
|
@ -148,6 +148,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
|
|||
'PointField', 'GeometryField', 'LineStringField',
|
||||
'PolygonField', 'MultiPointField', 'MultiLineStringField',
|
||||
'MultiPolygonField', 'GeometryCollectionField', 'GeomField',
|
||||
'GMLField',
|
||||
)
|
||||
if internal_type in geometry_fields:
|
||||
converters.append(self.convert_textfield_value)
|
||||
|
|
|
@ -3,7 +3,7 @@ from django.db.models.query import QuerySet
|
|||
|
||||
from django.contrib.gis.db.models import aggregates
|
||||
from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField
|
||||
from django.contrib.gis.db.models.sql import AreaField, DistanceField, GeomField, GeoQuery
|
||||
from django.contrib.gis.db.models.sql import AreaField, DistanceField, GeomField, GeoQuery, GMLField
|
||||
from django.contrib.gis.geometry.backend import Geometry
|
||||
from django.contrib.gis.measure import Area, Distance
|
||||
|
||||
|
@ -175,6 +175,8 @@ class GeoQuerySet(QuerySet):
|
|||
if backend.postgis:
|
||||
s['procedure_fmt'] = '%(version)s,%(geo_col)s,%(precision)s'
|
||||
s['procedure_args'] = {'precision': precision, 'version': version}
|
||||
if backend.oracle:
|
||||
s['select_field'] = GMLField()
|
||||
|
||||
return self._spatial_attribute('gml', s, **kwargs)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
|
||||
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField, GMLField
|
||||
from django.contrib.gis.db.models.sql.query import GeoQuery
|
||||
|
||||
__all__ = [
|
||||
'AreaField', 'DistanceField', 'GeomField', 'GeoQuery',
|
||||
'AreaField', 'DistanceField', 'GeomField', 'GMLField', 'GeoQuery',
|
||||
]
|
||||
|
|
|
@ -51,3 +51,15 @@ class GeomField(BaseField):
|
|||
|
||||
def get_internal_type(self):
|
||||
return 'GeometryField'
|
||||
|
||||
|
||||
class GMLField(BaseField):
|
||||
"""
|
||||
Wrapper for GML to be used by Oracle to ensure Database.LOB conversion.
|
||||
"""
|
||||
|
||||
def get_internal_type(self):
|
||||
return 'GMLField'
|
||||
|
||||
def from_db_value(self, value, connection):
|
||||
return value
|
||||
|
|
Loading…
Reference in New Issue