diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2020-06-29 21:16:13 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-06-29 21:16:13 +0100 |
commit | 39f042240d9084fd34d7cdfbafe3f83b12014f31 (patch) | |
tree | da70232fd06fabfb9b72263bb23bc3b99b90c361 /core/models_survex.py | |
parent | a60a495c83ab6eb8910f0778ee90e5f5fe8f5d82 (diff) | |
download | troggle-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.py | 21 |
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 |