diff --git a/core/models/survex.py b/core/models/survex.py index a9eee8f..6d662e9 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -186,8 +186,8 @@ class Wallet(models.Model): return str(self.walletname) + " (Survey Scans Folder)" class SingleScan(models.Model): - ffile = models.CharField(max_length=200) - name = models.CharField(max_length=200) + ffile = models.CharField(max_length=200) + name = models.CharField(max_length=200) scansfolder = models.ForeignKey("Wallet", null=True,on_delete=models.SET_NULL) class Meta: @@ -202,13 +202,13 @@ class SingleScan(models.Model): class DrawingFile(models.Model): dwgpath = models.CharField(max_length=200) dwgname = models.CharField(max_length=200) - bfontcolours = models.BooleanField(default=False) # UNUSED now, can be deleted - manyscansfolders = models.ManyToManyField("Wallet") # implicitly links via folders to scans to SVX files - scans = models.ManyToManyField("SingleScan") # implicitly links via scans to SVX files + bfontcolours = models.BooleanField(default=False) # UNUSED now, can be deleted + manywallets = models.ManyToManyField("Wallet") # implicitly links via folders to scans to SVX files + scans = models.ManyToManyField("SingleScan") # implicitly links via scans to SVX files dwgcontains = models.ManyToManyField("DrawingFile") # case when its a frame type - filesize = models.IntegerField(default=0) - npaths = models.IntegerField(default=0) - survexfiles = models.ManyToManyField("SurvexFile") # direct link to SVX files - not populated yet + filesize = models.IntegerField(default=0) + npaths = models.IntegerField(default=0) + survexfiles = models.ManyToManyField("SurvexFile") # direct link to SVX files - not populated yet class Meta: ordering = ('dwgpath',) \ No newline at end of file diff --git a/core/views/surveys.py b/core/views/surveys.py index c54d6de..952aa77 100644 --- a/core/views/surveys.py +++ b/core/views/surveys.py @@ -43,8 +43,8 @@ def scansingle(request, path, file): def scanswallets(request): - manyscansfolders = Wallet.objects.all() - return render(request, 'manyscansfolders.html', { 'manyscansfolders':manyscansfolders, 'settings': settings }) + manywallets = Wallet.objects.all() + return render(request, 'manywallets.html', { 'manywallets':manywallets, 'settings': settings }) def dwgdata(request): diff --git a/parsers/survex.py b/parsers/survex.py index c1d5a17..9686b2e 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -473,13 +473,13 @@ class LoadingSurvex(): message = " ! Wallet *REF {} - not numeric in '{}'".format(refscan, survexblock.survexfile.path) print((self.insp+message)) DataIssue.objects.create(parser='survex', message=message) - manyscansfolders = Wallet.objects.filter(walletname=refscan) - if manyscansfolders: - survexblock.scansfolder = manyscansfolders[0] # this is a ForeignKey field - print(manyscansfolders[0]) + manywallets = Wallet.objects.filter(walletname=refscan) + if manywallets: + survexblock.scansfolder = manywallets[0] # this is a ForeignKey field + print(manywallets[0]) survexblock.save() - if len(manyscansfolders) > 1: - message = " ! Wallet *REF {} - {} scan folders from DB search in {}".format(refscan, len(manyscansfolders), survexblock.survexfile.path) + if len(manywallets) > 1: + message = " ! Wallet *REF {} - {} scan folders from DB search in {}".format(refscan, len(manywallets), survexblock.survexfile.path) print((self.insp+message)) DataIssue.objects.create(parser='survex', message=message) else: diff --git a/parsers/surveys.py b/parsers/surveys.py index 9bc8ad7..cfe8db9 100644 --- a/parsers/surveys.py +++ b/parsers/surveys.py @@ -89,11 +89,11 @@ def LoadListScans(): print(' - deleting all scansFolder and scansSingle objects') # first do the smkhs (large kh survey scans) directory - manyscansfoldersmkhs = Wallet(fpath=os.path.join(settings.SURVEY_SCANS, "../surveys/smkhs"), walletname="smkhs") + manywallets_smkhs = Wallet(fpath=os.path.join(settings.SURVEY_SCANS, "../surveys/smkhs"), walletname="smkhs") print("smkhs", end=' ') - if os.path.isdir(manyscansfoldersmkhs.fpath): - manyscansfoldersmkhs.save() - LoadListScansFile(manyscansfoldersmkhs) + if os.path.isdir(manywallets_smkhs.fpath): + manywallets_smkhs.save() + LoadListScansFile(manywallets_smkhs) # iterate into the surveyscans directory @@ -144,7 +144,7 @@ def find_tunnel_scan(dwgfile, path): scansfile = scansfilel[0] if scansfolder: - dwgfile.manyscansfolders.add(scansfolder) + dwgfile.manywallets.add(scansfolder) if scansfile: dwgfile.scans.add(scansfile) diff --git a/templates/dwgfiles.html b/templates/dwgfiles.html index a73f36a..a89bca3 100644 --- a/templates/dwgfiles.html +++ b/templates/dwgfiles.html @@ -17,7 +17,7 @@
Scans folder | Files | Survex blocks |
---|---|---|
{{scansfolder.walletname}} | {{scansfolder.singlescan_set.all|length}} |