mirror of
https://github.com/django/django.git
synced 2024-12-22 09:05:43 +00:00
Refs #26753 -- Removed obsolete workarounds in GIS tests for lack of GDAL.
Missed in f7a363ee1d
.
This commit is contained in:
parent
9da45ff352
commit
7c6efb3233
@ -1,6 +1,6 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from ..models import models
|
||||
from ..utils import gisfield_may_be_null
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from ..models import models
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class NamedModel(models.Model):
|
||||
|
@ -1,7 +1,7 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from ..admin import admin
|
||||
from ..models import models
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
|
@ -1,6 +1,6 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from ..models import models
|
||||
from ..utils import gisfield_may_be_null
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from ..models import models
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class NamedModel(models.Model):
|
||||
|
@ -1,6 +1,5 @@
|
||||
from django.db import connection, migrations, models
|
||||
|
||||
from ...models import models as gis_models
|
||||
from django.contrib.gis.db import models
|
||||
from django.db import connection, migrations
|
||||
|
||||
ops = [
|
||||
migrations.CreateModel(
|
||||
@ -8,7 +7,7 @@ ops = [
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('geom', gis_models.MultiPolygonField(srid=4326)),
|
||||
('geom', models.MultiPolygonField(srid=4326)),
|
||||
],
|
||||
options={
|
||||
'required_db_features': ['gis_enabled'],
|
||||
@ -27,7 +26,7 @@ ops = [
|
||||
)),
|
||||
('address', models.CharField(max_length=100)),
|
||||
('zip_code', models.IntegerField(null=True, blank=True)),
|
||||
('geom', gis_models.PointField(srid=4326, geography=True)),
|
||||
('geom', models.PointField(srid=4326, geography=True)),
|
||||
],
|
||||
options={
|
||||
'required_db_features': ['gis_enabled'],
|
||||
@ -59,7 +58,7 @@ if connection.features.gis_enabled and connection.features.supports_raster:
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('rast', gis_models.fields.RasterField(srid=4326)),
|
||||
('rast', models.fields.RasterField(srid=4326)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
from ..models import models
|
||||
from django.contrib.gis.db import models
|
||||
|
||||
|
||||
class AllOGRFields(models.Model):
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from ..models import models
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class NamedModel(models.Model):
|
||||
|
@ -1,27 +0,0 @@
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db import models
|
||||
|
||||
|
||||
class DummyField(models.Field):
|
||||
def __init__(self, dim=None, srid=None, geography=None, spatial_index=True, *args, **kwargs):
|
||||
super(DummyField, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
try:
|
||||
from django.contrib.gis.db import models
|
||||
# Store a version of the original raster field for testing the exception
|
||||
# raised if GDAL isn't installed.
|
||||
models.OriginalRasterField = models.RasterField
|
||||
except ImproperlyConfigured:
|
||||
models.GeometryField = DummyField
|
||||
models.LineStringField = DummyField
|
||||
models.MultiPointField = DummyField
|
||||
models.MultiPolygonField = DummyField
|
||||
models.PointField = DummyField
|
||||
models.PolygonField = DummyField
|
||||
models.RasterField = DummyField
|
||||
|
||||
try:
|
||||
models.RasterField()
|
||||
except ImproperlyConfigured:
|
||||
models.RasterField = DummyField
|
@ -1,7 +1,6 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
|
||||
from ..models import models
|
||||
|
||||
if HAS_GDAL:
|
||||
class RasterModel(models.Model):
|
||||
rast = models.RasterField('A Verbose Raster Name', null=True, srid=4326, spatial_index=True, blank=True)
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.contrib.gis.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
from ..models import models
|
||||
|
||||
|
||||
class SimpleModel(models.Model):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user