forked from expo/troggle
move function
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.29 on 2020-06-23 22:48
|
||||
# Generated by Django 1.11.29 on 2020-06-26 23:53
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
@@ -351,13 +351,6 @@ class Migration(migrations.Migration):
|
||||
'ordering': ('id',),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SurvexEquate',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('cave', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Cave')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SurvexFile',
|
||||
fields=[
|
||||
@@ -392,7 +385,6 @@ class Migration(migrations.Migration):
|
||||
('y', models.FloatField(blank=True, null=True)),
|
||||
('z', models.FloatField(blank=True, null=True)),
|
||||
('block', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.SurvexBlock')),
|
||||
('equate', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.SurvexEquate')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@@ -414,9 +406,8 @@ class Migration(migrations.Migration):
|
||||
('filesize', models.IntegerField(default=0)),
|
||||
('npaths', models.IntegerField(default=0)),
|
||||
('manyscansfolders', models.ManyToManyField(to='core.ScansFolder')),
|
||||
('survexblocks', models.ManyToManyField(to='core.SurvexBlock')),
|
||||
('survexscans', models.ManyToManyField(to='core.SingleScan')),
|
||||
('survextitles', models.ManyToManyField(to='core.SurvexTitle')),
|
||||
('scans', models.ManyToManyField(to='core.SingleScan')),
|
||||
('survexfiles', models.ManyToManyField(to='core.SurvexFile')),
|
||||
('tunnelcontains', models.ManyToManyField(to='core.TunnelFile')),
|
||||
],
|
||||
options={
|
||||
|
||||
@@ -484,7 +484,7 @@ class LogbookEntry(TroggleModel):
|
||||
|
||||
|
||||
class QM(TroggleModel):
|
||||
#based on qm.csv in trunk/expoweb/1623/204 which has the fields:
|
||||
# based on qm.csv in trunk/expoweb/1623/204 which has the fields:
|
||||
#"Number","Grade","Area","Description","Page reference","Nearest station","Completion description","Comment"
|
||||
found_by = models.ForeignKey(LogbookEntry, related_name='QMs_found',blank=True, null=True,on_delete=models.CASCADE )
|
||||
ticked_off_by = models.ForeignKey(LogbookEntry, related_name='QMs_ticked_off',blank=True, null=True,on_delete=models.CASCADE)
|
||||
|
||||
@@ -7,13 +7,6 @@ from django.conf import settings
|
||||
from django.urls import reverse
|
||||
|
||||
|
||||
###########################################################
|
||||
# These will allow browsing and editing of the survex data
|
||||
###########################################################
|
||||
# Needs to add:
|
||||
# Equates
|
||||
# reloading
|
||||
|
||||
class SurvexDirectory(models.Model):
|
||||
path = models.CharField(max_length=200)
|
||||
cave = models.ForeignKey('Cave', blank=True, null=True,on_delete=models.CASCADE)
|
||||
@@ -52,9 +45,6 @@ class SurvexFile(models.Model):
|
||||
self.save()
|
||||
|
||||
|
||||
#class SurvexEquate(models.Model):
|
||||
# cave = models.ForeignKey('Cave', blank=True, null=True,on_delete=models.CASCADE)
|
||||
|
||||
class SurvexStationLookUpManager(models.Manager):
|
||||
def lookup(self, name):
|
||||
blocknames, sep, stationname = name.rpartition(".")
|
||||
@@ -132,16 +122,7 @@ class SurvexBlock(models.Model):
|
||||
else:
|
||||
res.append({'person':personrole.personexpedition.person, 'expeditionyear':personrole.personexpedition.expedition.year, 'roles':str(personrole.role)})
|
||||
return res
|
||||
|
||||
# def MakeSurvexStation(self, name):
|
||||
# ssl = self.survexstation_set.filter(name=name)
|
||||
# if ssl:
|
||||
# assert len(ssl) == 1
|
||||
# return ssl[0]
|
||||
# ss = SurvexStation(name=name, block=self)
|
||||
# #ss.save()
|
||||
# return ss
|
||||
|
||||
|
||||
def DayIndex(self):
|
||||
return list(self.expeditionday.survexblock_set.all()).index(self)
|
||||
|
||||
@@ -211,11 +192,9 @@ class TunnelFile(models.Model):
|
||||
bfontcolours = models.BooleanField(default=False)
|
||||
manyscansfolders = models.ManyToManyField("ScansFolder") # implicitly links to SVX files
|
||||
scans = models.ManyToManyField("SingleScan") # implicitly links to SVX files
|
||||
# survexblocks = models.ManyToManyField("SurvexBlock")
|
||||
tunnelcontains = models.ManyToManyField("TunnelFile") # case when its a frame type
|
||||
filesize = models.IntegerField(default=0)
|
||||
npaths = models.IntegerField(default=0)
|
||||
# survextitles = models.ManyToManyField("SurvexTitle")
|
||||
survexfiles = models.ManyToManyField("SurvexFile") # direct link to SVX files
|
||||
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user