diff --git a/core/models.py b/core/models.py index 9414e58..c1aa8b3 100644 --- a/core/models.py +++ b/core/models.py @@ -58,18 +58,6 @@ class TroggleModel(models.Model): class Meta: abstract = True -class TroggleImageModel(models.Model): - new_since_parsing = models.BooleanField(default=False, editable=False) - - def object_name(self): - return self._meta.object_name - - def get_admin_url(self): - return urllib.parse.urljoin(settings.URL_ROOT, "/admin/core/" + self.object_name().lower() + "/" + str(self.pk)) - - class Meta: - abstract = True - class DataIssue(TroggleModel): date = models.DateTimeField(auto_now_add=True, blank=True) parser = models.CharField(max_length=50, blank=True, null=True) diff --git a/core/models_caves.py b/core/models_caves.py index 0027a29..2a80218 100644 --- a/core/models_caves.py +++ b/core/models_caves.py @@ -18,7 +18,7 @@ from django.conf import settings from django.core.urlresolvers import reverse from django.template import Context, loader -from troggle.core.models import TroggleModel, TroggleImageModel, Person, Expedition +from troggle.core.models import TroggleModel, Person, Expedition from troggle.core.models_survex import SurvexStation class Area(TroggleModel): @@ -537,58 +537,6 @@ def get_scan_path(instance, filename): if str(instance.survey.wallet_letter) != "None": number=str(instance.survey.wallet_letter) + number #two strings formatting because convention is 2009#01 or 2009#X01 return os.path.join('./',year,year+r'#'+number,str(instance.contents)+str(instance.number_in_wallet)+r'.jpg') - -# class ScannedImage(TroggleImageModel): - # file = models.ImageField(storage=scansFileStorage, upload_to=get_scan_path) - # scanned_by = models.ForeignKey(Person,blank=True, null=True) - # scanned_on = models.DateField(null=True) - # survey = models.ForeignKey('Survey') - # contents = models.CharField(max_length=20,choices=(('notes','notes'),('plan','plan_sketch'),('elevation','elevation_sketch'))) - # number_in_wallet = models.IntegerField(null=True) - # lon_utm = models.FloatField(blank=True,null=True) - # lat_utm = models.FloatField(blank=True,null=True) - - # #content_type = models.ForeignKey(ContentType) - # #object_id = models.PositiveIntegerField() - # #location = generic.GenericForeignKey('content_type', 'object_id') - - # #This is an ugly hack to deal with the #s in our survey scan paths. The correct thing is to write a custom file storage backend which calls urlencode on the name for making file.url but not file.path. - # def correctURL(self): - # return string.replace(self.file.url,r'#',r'%23') - - # 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) - - # def notes(self): - # return self.scannedimage_set.filter(contents='notes') - - # def plans(self): - # return self.scannedimage_set.filter(contents='plan') - - # def elevations(self): - # return self.scannedimage_set.filter(contents='elevation') - # # Single Person going on a trip, which may or may not be written up (accounts for different T/U for people in same logbook entry) # diff --git a/parsers/imports.py b/parsers/imports.py index 65228f8..e5c7eb8 100644 --- a/parsers/imports.py +++ b/parsers/imports.py @@ -48,14 +48,6 @@ def import_survexpos(): print("Importing Survex x/y/z Positions") troggle.parsers.survex.LoadPos() -def import_surveyimgs(): - """This appears to store data in unused objects. The code is kept - for future re-working to manage progress against notes, plans and elevs. - """ - #import troggle.parsers.surveys - print("NOT Importing survey images") - #troggle.parsers.surveys.parseSurveys(logfile=settings.LOGFILE) - def import_tunnelfiles(): print("Importing Tunnel files") troggle.parsers.surveys.LoadTunnelFiles() diff --git a/templates/survey.html b/templates/survey.html deleted file mode 100644 index 13a8800..0000000 --- a/templates/survey.html +++ /dev/null @@ -1,193 +0,0 @@ -{% extends "base.html" %} -{% load wiki_markup %} - - -{% block title %}CUCC Virtual Survey Binder: {{ current_expedition }}{{ current_survey }}{%endblock%} -{% block head %} - - - - - -{% endblock %} - -
- {% for survey in current_expedition.survey_set.all %} - | {{ survey.wallet_number }} | - {% endfor %}
---|---|
Notes | - {% for survey in current_expedition.survey_set.all %} -{% if survey.notes %} - ✓ - {% endif %} | - {% endfor %}
Survex file | - {% for survey in current_expedition.survey_set.all %} -{% if survey.survex_file %} - ✓ - {% endif %} | - {% endfor %}
Plans | - {% for survey in current_expedition.survey_set.all %} -{% if survey.plans %} - ✓ - {% endif %} | - {% endfor %}
Elevations | - {% for survey in current_expedition.survey_set.all %} -{% if survey.elevations %} - ✓ - {% endif %} | - {% endfor %}
-
File at: {{ noteItem.file.name }}
- Scanned by: {{ noteItem.scanned_by }}
- On: {{ noteItem.scanned_on }}
-
-
File at: {{ sketchItem.file.name }}
- Scanned by: {{ sketchItem.scanned_by }}
- On: {{ sketchItem.scanned_on }}
-