2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 16:51:54 +00:00

Added url to cave and turned entrances station names and removed the previous SurveyStation model.

Note caves should be rendered in the directory of their original url to make links work.
Note SurveyStations appeared to duplicate SurvexStations.
Note Given we want to be running from a mercurial repository, it is easiest to store the names of survey stations rather than foreign keys.
This commit is contained in:
Martin Green 2011-07-10 23:52:18 +01:00
parent c37124d9c4
commit 44f86a7d6f

View File

@ -368,6 +368,7 @@ class Cave(TroggleModel):
extent = models.CharField(max_length=100,blank=True,null=True)
survex_file = models.CharField(max_length=100,blank=True,null=True)
description_file = models.CharField(max_length=200,blank=True,null=True)
url = models.CharField(max_length=200,blank=True,null=True)
#class Meta:
# unique_together = (("area", "kataster_number"), ("area", "unofficial_number"))
@ -466,11 +467,7 @@ class OtherCaveName(TroggleModel):
cave = models.ForeignKey(Cave)
def __unicode__(self):
return unicode(self.name)
class SurveyStation(TroggleModel):
name = models.CharField(max_length=200)
def __unicode__(self):
return unicode(self.name)
class Entrance(TroggleModel):
slug = models.SlugField(max_length=50, unique = True)
@ -504,9 +501,9 @@ class Entrance(TroggleModel):
alt = models.TextField(blank=True, null=True)
northing = models.TextField(blank=True, null=True)
easting = models.TextField(blank=True, null=True)
tag_station = models.ForeignKey(SurveyStation, blank=True,null=True, related_name="tag_station")
exact_station = models.ForeignKey(SurveyStation, blank=True,null=True, related_name="exact_station")
other_station = models.ForeignKey(SurveyStation, blank=True,null=True, related_name="other_station")
tag_station = models.TextField()
exact_station = models.TextField()
other_station = models.TextField()
other_description = models.TextField(blank=True,null=True)
bearings = models.TextField(blank=True,null=True)
def __unicode__(self):
@ -623,7 +620,7 @@ class DPhoto(TroggleImageModel):
is_mugshot = models.BooleanField(default=False)
contains_cave = models.ForeignKey(Cave,blank=True,null=True)
contains_entrance = models.ForeignKey(Entrance, related_name="photo_file",blank=True,null=True)
nearest_survey_point = models.ForeignKey(SurveyStation,blank=True,null=True)
#nearest_survey_point = models.ForeignKey(SurveyStation,blank=True,null=True)
nearest_QM = models.ForeignKey(QM,blank=True,null=True)
lon_utm = models.FloatField(blank=True,null=True)
lat_utm = models.FloatField(blank=True,null=True)