authority record to feature is one-to-many not many-to-many
This commit is contained in:
parent
f0a35d78de
commit
e4d535ea06
|
@ -6,13 +6,13 @@ from django.contrib.gis.db import models
|
||||||
class AuthorityRecord(models.Model):
|
class AuthorityRecord(models.Model):
|
||||||
uri = models.CharField(max_length=512)
|
uri = models.CharField(max_length=512)
|
||||||
preferred_name = models.CharField(max_length=255)
|
preferred_name = models.CharField(max_length=255)
|
||||||
features = models.ManyToManyField("Feature", blank=True)
|
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.preferred_name
|
return self.preferred_name
|
||||||
|
|
||||||
|
|
||||||
class Feature(models.Model):
|
class Feature(models.Model):
|
||||||
|
authority_record = models.ForeignKey(AuthorityRecord)
|
||||||
url = models.CharField(max_length=512, unique=True, verbose_name="URI")
|
url = models.CharField(max_length=512, unique=True, verbose_name="URI")
|
||||||
preferred_name = models.CharField(max_length=512)
|
preferred_name = models.CharField(max_length=512)
|
||||||
feature_type = models.ForeignKey("FeatureType", null=True, blank=True)
|
feature_type = models.ForeignKey("FeatureType", null=True, blank=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user