2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 17:17:07 +00:00

Fix SurvexDirectory import

This commit is contained in:
Philip Sargent
2020-06-29 21:16:13 +01:00
parent a60a495c83
commit 39f042240d
2 changed files with 78 additions and 58 deletions

View File

@@ -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