mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-21 23:01:52 +00:00
reanme manyscansfolders to manywallets
This commit is contained in:
parent
7dd5840353
commit
7f64670f36
@ -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',)
|
@ -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):
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
<td align="right" style="padding:2px">{{dwgfile.npaths}}</td>
|
||||
|
||||
<td style="padding:2px">
|
||||
{% for scansfolder in dwgfile.manyscansfolders.all %}
|
||||
{% for scansfolder in dwgfile.manywallets.all %}
|
||||
<a href="{{scansfolder.get_absolute_url}}">{{scansfolder.walletname}}</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
|
@ -13,7 +13,7 @@ hand-drawn passage sections are drawn. These hand-drawn passages will eventually
|
||||
traced to produce Tunnel or Therion drawings and eventually the final complete cave survey.
|
||||
<table width=95%>
|
||||
<tr><th>Scans folder</th><th>Files</th><th>Survex blocks</th></tr>
|
||||
{% for scansfolder in manyscansfolders %}
|
||||
{% for scansfolder in manywallets %}
|
||||
<tr>
|
||||
<td style="padding:2px"><a href="{{scansfolder.get_absolute_url}}">{{scansfolder.walletname}}</a></td>
|
||||
<td align="right" style="padding:2px">{{scansfolder.singlescan_set.all|length}}</td>
|
Loading…
Reference in New Issue
Block a user