summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-04-26 18:11:14 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2021-04-26 18:11:14 +0100
commitdc840c9bc773fa848e8903d65e657333c3ad2cd2 (patch)
tree5e3eb0f356ca7cbe8f49fac1b555c5fa982ad2d1 /core
parent37403a7234a78ff10af4310b91e2258eef8bfb14 (diff)
downloadtroggle-dc840c9bc773fa848e8903d65e657333c3ad2cd2.tar.gz
troggle-dc840c9bc773fa848e8903d65e657333c3ad2cd2.tar.bz2
troggle-dc840c9bc773fa848e8903d65e657333c3ad2cd2.zip
tunnelpath to dwgpath
Diffstat (limited to 'core')
-rw-r--r--core/models/survex.py4
-rw-r--r--core/views/surveys.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/core/models/survex.py b/core/models/survex.py
index 31f4646..7551470 100644
--- a/core/models/survex.py
+++ b/core/models/survex.py
@@ -200,7 +200,7 @@ class SingleScan(models.Model):
return "Survey Scan Image: " + str(self.name) + " in " + str(self.scansfolder)
class DrawingFile(models.Model):
- tunnelpath = models.CharField(max_length=200)
+ dwgpath = models.CharField(max_length=200)
tunnelname = models.CharField(max_length=200)
bfontcolours = models.BooleanField(default=False) # UNUSED now, can be deleted
manyscansfolders = models.ManyToManyField("ScansFolder") # implicitly links via folders to scans to SVX files
@@ -211,4 +211,4 @@ class DrawingFile(models.Model):
survexfiles = models.ManyToManyField("SurvexFile") # direct link to SVX files - not populated yet
class Meta:
- ordering = ('tunnelpath',) \ No newline at end of file
+ ordering = ('dwgpath',) \ No newline at end of file
diff --git a/core/views/surveys.py b/core/views/surveys.py
index d149d4e..cf18fdd 100644
--- a/core/views/surveys.py
+++ b/core/views/surveys.py
@@ -59,12 +59,12 @@ def dwgfilesingle(request, path):
but it might be a Therion file
'''
try:
- dwgfile = DrawingFile.objects.get(tunnelpath=urlunquote(path))
+ dwgfile = DrawingFile.objects.get(dwgpath=urlunquote(path))
except:
message = f'Drawing file error or not found \'{path}\' .'
return render(request, 'errors/generic.html', {'message': message})
- tfile = Path(settings.TUNNEL_DATA, dwgfile.tunnelpath)
+ tfile = Path(settings.TUNNEL_DATA, dwgfile.dwgpath)
try: # for display not download
return HttpResponse(content=open(tfile, errors='strict'), content_type="text/xhtml")
except UnicodeDecodeError:
@@ -82,11 +82,11 @@ def dwgfileupload(request, path):
'''uploads a drawing file, but where is the Form? This just processes POST info. Apparently unfinished?
'''
try:
- dwgfile = DrawingFile.objects.get(tunnelpath=urlunquote(path)) # need to check if inavlid query string and produce friendly error
+ dwgfile = DrawingFile.objects.get(dwgpath=urlunquote(path)) # need to check if inavlid query string and produce friendly error
except:
message = f'Drawing file error or not found \'{path}\' .'
return render(request, 'errors/generic.html', {'message': message})
- tfile = Path(settings.TUNNEL_DATA, dwgfile.tunnelpath)
+ tfile = Path(settings.TUNNEL_DATA, dwgfile.dwgpath)
project, user, password, tunnelversion = request.POST["tunnelproject"], request.POST["tunneluser"], request.POST["tunnelpassword"], request.POST["tunnelversion"]
print(project, user, tunnelversion)