summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2011-07-10 23:52:18 +0100
committerMartin Green <martin.speleo@gmail.com>2011-07-10 23:52:18 +0100
commit44f86a7d6fbce2bd9f446cba969d47daa6c74323 (patch)
treedf35d18ea5487b134169a0dd1c8ca4e33a7059bd /core
parentc37124d9c4be8d3ec9169cd3d508b8f424b8b9cd (diff)
downloadtroggle-44f86a7d6fbce2bd9f446cba969d47daa6c74323.tar.gz
troggle-44f86a7d6fbce2bd9f446cba969d47daa6c74323.tar.bz2
troggle-44f86a7d6fbce2bd9f446cba969d47daa6c74323.zip
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.
Diffstat (limited to 'core')
-rw-r--r--core/models.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/core/models.py b/core/models.py
index f8e7400..1c08a25 100644
--- a/core/models.py
+++ b/core/models.py
@@ -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)