2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

Remove unused Survey object

This commit is contained in:
Philip Sargent 2020-06-04 23:16:26 +01:00
parent 43c6e2f2e1
commit ac9ac5e397
5 changed files with 32 additions and 33 deletions

View File

@ -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)

View File

@ -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')

View File

@ -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')

View File

@ -94,7 +94,6 @@
<li><a id="expeditionsLink" href="{% url "expeditions" %}">list all</a></li>
</ul>
</li>
<li><a id="surveyBinderLink" href="{% url "survey" %}">survey binder</a></li>
<li><a href="#">diversions</a>
<ul class="sub_menu">
<li><a href="{% url "stats" %}">statistics</a></li>

View File

@ -75,8 +75,8 @@ actualurlpatterns = patterns('',
url(r'^statistics/?$', views_other.stats, name="stats"),
url(r'^survey/?$', surveyindex, name="survey"),
url(r'^survey/(?P<year>\d\d\d\d)\#(?P<wallet_number>\d*)$', survey, name="survey"),
# url(r'^survey/?$', surveyindex, name="survey"), #url referred to troggle menu..
# url(r'^survey/(?P<year>\d\d\d\d)\#(?P<wallet_number>\d*)$', survey, name="survey"), #Survey object
# Is all this lot out of date ? Maybe the logbooks work?
url(r'^controlpanel/?$', views_other.controlPanel, name="controlpanel"),