1
0
mirror of https://github.com/django/django.git synced 2024-11-18 15:34:16 +00:00
django/tests/gis_tests/rasterapp/models.py
Claude Paroz f7a363ee1d Fixed #26753 -- Made GDAL a required dependency for contrib.gis
Thanks Tim Graham for the review.
2016-06-18 10:58:02 +02:00

25 lines
761 B
Python

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)
rastprojected = models.RasterField('A Projected Raster Table', srid=3086, null=True)
geom = models.PointField(null=True)
class Meta:
required_db_features = ['supports_raster']
def __str__(self):
return str(self.id)
class RasterRelatedModel(models.Model):
rastermodel = models.ForeignKey(RasterModel, models.CASCADE)
class Meta:
required_db_features = ['supports_raster']
def __str__(self):
return str(self.id)