forked from expo/troggle
Improve README
Make new style QMs from survexfiles work
This commit is contained in:
@@ -47,6 +47,8 @@ class SurvexFile(models.Model):
|
||||
def SetDirectory(self):
|
||||
dirpath = os.path.split(self.path)[0]
|
||||
survexdirectorylist = SurvexDirectory.objects.filter(cave=self.cave, path=dirpath)
|
||||
# if self.cave is '' or self.cave is None:
|
||||
# print('No cave set for survex dir %s' % self.path)
|
||||
if survexdirectorylist:
|
||||
self.survexdirectory = survexdirectorylist[0]
|
||||
else:
|
||||
@@ -74,8 +76,11 @@ class SurvexStation(models.Model):
|
||||
z = models.FloatField(blank=True, null=True)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.block.cave.slug() + '/' + self.block.name + '/' + self.name or 'No station name'
|
||||
|
||||
if self.block.cave:
|
||||
# If we haven't got a cave we can't have a slug, saves a nonetype return
|
||||
return self.block.cave.slug() + '/' + self.block.name + '/' + self.name or 'No station name'
|
||||
else:
|
||||
return str(self.block.cave) + '/' + self.block.name + '/' + self.name or 'No station name'
|
||||
def path(self):
|
||||
r = self.name
|
||||
b = self.block
|
||||
|
||||
Reference in New Issue
Block a user