From ac9ac5e397884770f801b787126b2b30ab9b5c93 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 4 Jun 2020 23:16:26 +0100 Subject: [PATCH] Remove unused Survey object --- core/admin.py | 4 ++-- core/models_caves.py | 40 ++++++++++++++++++++-------------------- core/views_caves.py | 16 ++++++++-------- templates/base.html | 1 - urls.py | 4 ++-- 5 files changed, 32 insertions(+), 33 deletions(-) diff --git a/core/admin.py b/core/admin.py index 2b02dd1..6b272f5 100644 --- a/core/admin.py +++ b/core/admin.py @@ -6,7 +6,7 @@ from django.core import serializers from troggle.core.views_other import downloadLogbook from troggle.core.models import * -from troggle.core.models_caves import Cave, Area, Entrance, CaveAndEntrance, NewSubCave, OtherCaveName, CaveDescription, LogbookEntry, PersonTrip, Survey, QM +from troggle.core.models_caves import Cave, Area, Entrance, CaveAndEntrance, NewSubCave, OtherCaveName, CaveDescription, LogbookEntry, PersonTrip, QM from troggle.core.models_survex import SurvexBlock, SurvexPersonRole, SurvexStation, SurvexScansFolder, SurvexScanSingle #from troggle.reversion.admin import VersionAdmin #django-reversion version control @@ -136,7 +136,7 @@ admin.site.register(PersonExpedition,PersonExpeditionAdmin) admin.site.register(LogbookEntry, LogbookEntryAdmin) #admin.site.register(PersonTrip) admin.site.register(QM, QMAdmin) -admin.site.register(Survey, SurveyAdmin) +#admin.site.register(Survey, SurveyAdmin) #admin.site.register(ScannedImage) admin.site.register(SurvexStation) diff --git a/core/models_caves.py b/core/models_caves.py index 0d35583..ac6dd34 100644 --- a/core/models_caves.py +++ b/core/models_caves.py @@ -559,26 +559,26 @@ def get_scan_path(instance, filename): # def __str__(self): # return get_scan_path(self,'') -class Survey(TroggleModel): - expedition = models.ForeignKey('Expedition') #REDUNDANT (logbook_entry) - wallet_number = models.IntegerField(blank=True,null=True) - wallet_letter = models.CharField(max_length=1,blank=True,null=True) - comments = models.TextField(blank=True,null=True) - location = models.CharField(max_length=400,blank=True,null=True) #REDUNDANT - subcave = models.ForeignKey('NewSubCave', blank=True, null=True) - #notes_scan = models.ForeignKey('ScannedImage',related_name='notes_scan',blank=True, null=True) #Replaced by contents field of ScannedImage model - survex_block = models.OneToOneField('SurvexBlock',blank=True, null=True) - logbook_entry = models.ForeignKey('LogbookEntry') - centreline_printed_on = models.DateField(blank=True, null=True) - centreline_printed_by = models.ForeignKey('Person',related_name='centreline_printed_by',blank=True,null=True) - #sketch_scan = models.ForeignKey(ScannedImage,blank=True, null=True) #Replaced by contents field of ScannedImage model - tunnel_file = models.FileField(upload_to='surveyXMLfiles',blank=True, null=True) - tunnel_main_sketch = models.ForeignKey('Survey',blank=True,null=True) - integrated_into_main_sketch_on = models.DateField(blank=True,null=True) - integrated_into_main_sketch_by = models.ForeignKey('Person' ,related_name='integrated_into_main_sketch_by', blank=True,null=True) - rendered_image = models.ImageField(upload_to='renderedSurveys',blank=True,null=True) - def __str__(self): - return self.expedition.year+"#"+"%02d" % int(self.wallet_number) +# class Survey(TroggleModel): + # expedition = models.ForeignKey('Expedition') #REDUNDANT (logbook_entry) + # wallet_number = models.IntegerField(blank=True,null=True) + # wallet_letter = models.CharField(max_length=1,blank=True,null=True) + # comments = models.TextField(blank=True,null=True) + # location = models.CharField(max_length=400,blank=True,null=True) #REDUNDANT + # subcave = models.ForeignKey('NewSubCave', blank=True, null=True) + # #notes_scan = models.ForeignKey('ScannedImage',related_name='notes_scan',blank=True, null=True) #Replaced by contents field of ScannedImage model + # survex_block = models.OneToOneField('SurvexBlock',blank=True, null=True) + # logbook_entry = models.ForeignKey('LogbookEntry') + # centreline_printed_on = models.DateField(blank=True, null=True) + # centreline_printed_by = models.ForeignKey('Person',related_name='centreline_printed_by',blank=True,null=True) + # #sketch_scan = models.ForeignKey(ScannedImage,blank=True, null=True) #Replaced by contents field of ScannedImage model + # tunnel_file = models.FileField(upload_to='surveyXMLfiles',blank=True, null=True) + # tunnel_main_sketch = models.ForeignKey('Survey',blank=True,null=True) + # integrated_into_main_sketch_on = models.DateField(blank=True,null=True) + # integrated_into_main_sketch_by = models.ForeignKey('Person' ,related_name='integrated_into_main_sketch_by', blank=True,null=True) + # rendered_image = models.ImageField(upload_to='renderedSurveys',blank=True,null=True) + # def __str__(self): + # return self.expedition.year+"#"+"%02d" % int(self.wallet_number) # def notes(self): # return self.scannedimage_set.filter(contents='notes') diff --git a/core/views_caves.py b/core/views_caves.py index d9d6682..943e797 100644 --- a/core/views_caves.py +++ b/core/views_caves.py @@ -22,7 +22,7 @@ from django.shortcuts import get_object_or_404, render import troggle.settings as settings import troggle.core.models as models from troggle.core.models import Expedition -from troggle.core.models_caves import CaveSlug, Cave, CaveAndEntrance, Survey, QM, CaveDescription, EntranceSlug, Entrance, Area, SurvexStation +from troggle.core.models_caves import CaveSlug, Cave, CaveAndEntrance, QM, CaveDescription, EntranceSlug, Entrance, Area, SurvexStation from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm from troggle.helper import login_required_if_public @@ -267,14 +267,14 @@ def surveyindex(request): expeditions=Expedition.objects.order_by("-year") return render(request,'survey.html',locals()) -def survey(request,year,wallet_number): - surveys=Survey.objects.all() - expeditions=Expedition.objects.order_by("-year") - current_expedition=Expedition.objects.filter(year=year)[0] +# def survey(request,year,wallet_number): + # surveys=Survey.objects.all() + # expeditions=Expedition.objects.order_by("-year") + # current_expedition=Expedition.objects.filter(year=year)[0] - if wallet_number!='': - current_survey=Survey.objects.filter(expedition=current_expedition,wallet_number=wallet_number)[0] - # notes=current_survey.scannedimage_set.filter(contents='notes') + # if wallet_number!='': + # current_survey=Survey.objects.filter(expedition=current_expedition,wallet_number=wallet_number)[0] + # # notes=current_survey.scannedimage_set.filter(contents='notes') # planSketches=current_survey.scannedimage_set.filter(contents='plan') # elevationSketches=current_survey.scannedimage_set.filter(contents='elevation') diff --git a/templates/base.html b/templates/base.html index f9d4bc8..495705a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -94,7 +94,6 @@
  • list all
  • -
  • survey binder
  • diversions