tunnelfile.scans name change for compatibility

This commit is contained in:
Philip Sargent 2020-06-24 00:36:32 +01:00
parent c91aa4be47
commit d6c4ffca5a
3 changed files with 4 additions and 4 deletions

@ -217,8 +217,8 @@ class TunnelFile(models.Model):
tunnelpath = models.CharField(max_length=200) tunnelpath = models.CharField(max_length=200)
tunnelname = models.CharField(max_length=200) tunnelname = models.CharField(max_length=200)
bfontcolours = models.BooleanField(default=False) bfontcolours = models.BooleanField(default=False)
manyscansfolders = models.ManyToManyField("ScansFolder") manyscansfolders = models.ManyToManyField("ScansFolder")
survexscans = models.ManyToManyField("SingleScan") scans = models.ManyToManyField("SingleScan")
survexblocks = models.ManyToManyField("SurvexBlock") survexblocks = models.ManyToManyField("SurvexBlock")
tunnelcontains = models.ManyToManyField("TunnelFile") # case when its a frame type tunnelcontains = models.ManyToManyField("TunnelFile") # case when its a frame type
filesize = models.IntegerField(default=0) filesize = models.IntegerField(default=0)

@ -135,7 +135,7 @@ def FindTunnelScan(tunnelfile, path):
if scansfolder: if scansfolder:
tunnelfile.manyscansfolders.add(scansfolder) tunnelfile.manyscansfolders.add(scansfolder)
if scansfile: if scansfile:
tunnelfile.survexscans.add(scansfile) tunnelfile.scans.add(scansfile)
elif path and not re.search(rb"\.(?:png|jpg|pdf|jpeg)$(?i)", path): elif path and not re.search(rb"\.(?:png|jpg|pdf|jpeg)$(?i)", path):
name = os.path.split(path)[1] name = os.path.split(path)[1]

@ -23,7 +23,7 @@
</td> </td>
<td> <td>
{% for singlescan in tunnelfile.survexscans.all %} {% for singlescan in tunnelfile.scans.all %}
<a href="{{singlescan.get_absolute_url}}">{{singlescan.name}}</a> <a href="{{singlescan.get_absolute_url}}">{{singlescan.name}}</a>
{% endfor %} {% endfor %}
</td> </td>