summaryrefslogtreecommitdiffstats
path: root/core/models_survex.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2020-06-29 21:16:13 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2020-06-29 21:16:13 +0100
commit39f042240d9084fd34d7cdfbafe3f83b12014f31 (patch)
treeda70232fd06fabfb9b72263bb23bc3b99b90c361 /core/models_survex.py
parenta60a495c83ab6eb8910f0778ee90e5f5fe8f5d82 (diff)
downloadtroggle-39f042240d9084fd34d7cdfbafe3f83b12014f31.tar.gz
troggle-39f042240d9084fd34d7cdfbafe3f83b12014f31.tar.bz2
troggle-39f042240d9084fd34d7cdfbafe3f83b12014f31.zip
Fix SurvexDirectory import
Diffstat (limited to 'core/models_survex.py')
-rw-r--r--core/models_survex.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/core/models_survex.py b/core/models_survex.py
index 89fe4a4..4f53993 100644
--- a/core/models_survex.py
+++ b/core/models_survex.py
@@ -16,8 +16,9 @@ class SurvexDirectory(models.Model):
class Meta:
ordering = ('id',)
- def __str__(self):
- return "[SurvexDirectory:"+str(self.path) + "-" + str(self.primarysurvexfile.path) + "-" + str(self.cave)+"]"
+ # Don't change from the default as that breaks troggle webpages and internal referencing!
+ # def __str__(self):
+ # return "[SurvexDirectory:"+str(self.path) + "-" + str(self.primarysurvexfile.path) + "-" + str(self.cave)+"]"
@@ -29,8 +30,9 @@ class SurvexFile(models.Model):
class Meta:
ordering = ('id',)
- def __str__(self):
- return "[SurvexFile:"+str(self.path) + "-" + str(self.survexdirectory) + "-" + str(self.cave)+"]"
+ # Don't change from the default as that breaks troggle webpages and internal referencing!
+ # def __str__(self):
+ # return "[SurvexFile:"+str(self.path) + "-" + str(self.survexdirectory) + "-" + str(self.cave)+"]"
def exists(self):
fname = os.path.join(settings.SURVEX_DATA, self.path + ".svx")
@@ -117,10 +119,15 @@ class SurvexBlock(models.Model):
class Meta:
ordering = ('id',)
+ # Don't change from the original as that breaks troggle webpages and internal referencing!
+ # def __str__(self):
+ # return "[SurvexBlock:"+ str(self.name) + "-path:" + \
+ # str(self.survexpath) + "-cave:" + \
+ # str(self.cave) + "]"
def __str__(self):
- return "[SurvexBlock:"+ str(self.name) + "-path:" + \
- str(self.survexpath) + "-cave:" + \
- str(self.cave) + "]"
+ return self.name and str(self.name) or 'no name'
+
+
def isSurvexBlock(self): # Function used in templates