mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
@@ -1,6 +1,7 @@
|
||||
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):
|
||||
@@ -10,6 +11,7 @@ class NamedModel(models.Model):
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
required_db_features = ['gis_enabled']
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -38,6 +40,7 @@ class City(NamedModel):
|
||||
|
||||
class Meta:
|
||||
app_label = 'layermap'
|
||||
required_db_features = ['gis_enabled']
|
||||
|
||||
|
||||
class Interstate(NamedModel):
|
||||
@@ -46,6 +49,7 @@ class Interstate(NamedModel):
|
||||
|
||||
class Meta:
|
||||
app_label = 'layermap'
|
||||
required_db_features = ['gis_enabled']
|
||||
|
||||
|
||||
# Same as `City` above, but for testing model inheritance.
|
||||
@@ -72,6 +76,9 @@ class ICity2(ICity1):
|
||||
class Invalid(models.Model):
|
||||
point = models.PointField()
|
||||
|
||||
class Meta:
|
||||
required_db_features = ['gis_enabled']
|
||||
|
||||
|
||||
# Mapping dictionaries for the models above.
|
||||
co_mapping = {
|
||||
|
||||
Reference in New Issue
Block a user