mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-04-03 09:21:48 +01:00
Comment-out all ScannedImage objects
This commit is contained in:
parent
ae89a707ec
commit
c6d68749e0
@ -6,7 +6,7 @@ from django.core import serializers
|
|||||||
|
|
||||||
from troggle.core.views_other import downloadLogbook
|
from troggle.core.views_other import downloadLogbook
|
||||||
from troggle.core.models import *
|
from troggle.core.models import *
|
||||||
from troggle.core.models_caves import Cave, Area, Entrance, CaveAndEntrance, NewSubCave, OtherCaveName, CaveDescription, LogbookEntry, PersonTrip, Survey, ScannedImage, QM
|
from troggle.core.models_caves import Cave, Area, Entrance, CaveAndEntrance, NewSubCave, OtherCaveName, CaveDescription, LogbookEntry, PersonTrip, Survey, QM
|
||||||
from troggle.core.models_survex import SurvexBlock, SurvexPersonRole, SurvexStation, SurvexScansFolder, SurvexScanSingle
|
from troggle.core.models_survex import SurvexBlock, SurvexPersonRole, SurvexStation, SurvexScansFolder, SurvexScanSingle
|
||||||
#from troggle.reversion.admin import VersionAdmin #django-reversion version control
|
#from troggle.reversion.admin import VersionAdmin #django-reversion version control
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ class SurvexBlockAdmin(TroggleModelAdmin):
|
|||||||
inlines = (RoleInline,)
|
inlines = (RoleInline,)
|
||||||
|
|
||||||
|
|
||||||
class ScannedImageInline(admin.TabularInline):
|
# class ScannedImageInline(admin.TabularInline):
|
||||||
model = ScannedImage
|
# model = ScannedImage
|
||||||
extra = 4
|
# extra = 4
|
||||||
|
|
||||||
|
|
||||||
class OtherCaveInline(admin.TabularInline):
|
class OtherCaveInline(admin.TabularInline):
|
||||||
@ -42,7 +42,7 @@ class OtherCaveInline(admin.TabularInline):
|
|||||||
|
|
||||||
|
|
||||||
class SurveyAdmin(TroggleModelAdmin):
|
class SurveyAdmin(TroggleModelAdmin):
|
||||||
inlines = (ScannedImageInline,)
|
#inlines = (ScannedImageInline,)
|
||||||
search_fields = ('expedition__year','wallet_number')
|
search_fields = ('expedition__year','wallet_number')
|
||||||
|
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ admin.site.register(LogbookEntry, LogbookEntryAdmin)
|
|||||||
#admin.site.register(PersonTrip)
|
#admin.site.register(PersonTrip)
|
||||||
admin.site.register(QM, QMAdmin)
|
admin.site.register(QM, QMAdmin)
|
||||||
admin.site.register(Survey, SurveyAdmin)
|
admin.site.register(Survey, SurveyAdmin)
|
||||||
admin.site.register(ScannedImage)
|
#admin.site.register(ScannedImage)
|
||||||
admin.site.register(SurvexStation)
|
admin.site.register(SurvexStation)
|
||||||
|
|
||||||
admin.site.register(SurvexScansFolder)
|
admin.site.register(SurvexScansFolder)
|
||||||
|
@ -538,26 +538,26 @@ def get_scan_path(instance, filename):
|
|||||||
number=str(instance.survey.wallet_letter) + number #two strings formatting because convention is 2009#01 or 2009#X01
|
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')
|
return os.path.join('./',year,year+r'#'+number,str(instance.contents)+str(instance.number_in_wallet)+r'.jpg')
|
||||||
|
|
||||||
class ScannedImage(TroggleImageModel):
|
# class ScannedImage(TroggleImageModel):
|
||||||
file = models.ImageField(storage=scansFileStorage, upload_to=get_scan_path)
|
# file = models.ImageField(storage=scansFileStorage, upload_to=get_scan_path)
|
||||||
scanned_by = models.ForeignKey(Person,blank=True, null=True)
|
# scanned_by = models.ForeignKey(Person,blank=True, null=True)
|
||||||
scanned_on = models.DateField(null=True)
|
# scanned_on = models.DateField(null=True)
|
||||||
survey = models.ForeignKey('Survey')
|
# survey = models.ForeignKey('Survey')
|
||||||
contents = models.CharField(max_length=20,choices=(('notes','notes'),('plan','plan_sketch'),('elevation','elevation_sketch')))
|
# contents = models.CharField(max_length=20,choices=(('notes','notes'),('plan','plan_sketch'),('elevation','elevation_sketch')))
|
||||||
number_in_wallet = models.IntegerField(null=True)
|
# number_in_wallet = models.IntegerField(null=True)
|
||||||
lon_utm = models.FloatField(blank=True,null=True)
|
# lon_utm = models.FloatField(blank=True,null=True)
|
||||||
lat_utm = models.FloatField(blank=True,null=True)
|
# lat_utm = models.FloatField(blank=True,null=True)
|
||||||
|
|
||||||
#content_type = models.ForeignKey(ContentType)
|
# #content_type = models.ForeignKey(ContentType)
|
||||||
#object_id = models.PositiveIntegerField()
|
# #object_id = models.PositiveIntegerField()
|
||||||
#location = generic.GenericForeignKey('content_type', 'object_id')
|
# #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.
|
# #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):
|
# def correctURL(self):
|
||||||
return string.replace(self.file.url,r'#',r'%23')
|
# return string.replace(self.file.url,r'#',r'%23')
|
||||||
|
|
||||||
def __str__(self):
|
# def __str__(self):
|
||||||
return get_scan_path(self,'')
|
# return get_scan_path(self,'')
|
||||||
|
|
||||||
class Survey(TroggleModel):
|
class Survey(TroggleModel):
|
||||||
expedition = models.ForeignKey('Expedition') #REDUNDANT (logbook_entry)
|
expedition = models.ForeignKey('Expedition') #REDUNDANT (logbook_entry)
|
||||||
@ -580,14 +580,14 @@ class Survey(TroggleModel):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.expedition.year+"#"+"%02d" % int(self.wallet_number)
|
return self.expedition.year+"#"+"%02d" % int(self.wallet_number)
|
||||||
|
|
||||||
def notes(self):
|
# def notes(self):
|
||||||
return self.scannedimage_set.filter(contents='notes')
|
# return self.scannedimage_set.filter(contents='notes')
|
||||||
|
|
||||||
def plans(self):
|
# def plans(self):
|
||||||
return self.scannedimage_set.filter(contents='plan')
|
# return self.scannedimage_set.filter(contents='plan')
|
||||||
|
|
||||||
def elevations(self):
|
# def elevations(self):
|
||||||
return self.scannedimage_set.filter(contents='elevation')
|
# 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)
|
# 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)
|
||||||
|
@ -278,9 +278,9 @@ def survey(request,year,wallet_number):
|
|||||||
|
|
||||||
if wallet_number!='':
|
if wallet_number!='':
|
||||||
current_survey=Survey.objects.filter(expedition=current_expedition,wallet_number=wallet_number)[0]
|
current_survey=Survey.objects.filter(expedition=current_expedition,wallet_number=wallet_number)[0]
|
||||||
notes=current_survey.scannedimage_set.filter(contents='notes')
|
# notes=current_survey.scannedimage_set.filter(contents='notes')
|
||||||
planSketches=current_survey.scannedimage_set.filter(contents='plan')
|
# planSketches=current_survey.scannedimage_set.filter(contents='plan')
|
||||||
elevationSketches=current_survey.scannedimage_set.filter(contents='elevation')
|
# elevationSketches=current_survey.scannedimage_set.filter(contents='elevation')
|
||||||
|
|
||||||
return render(request,'survey.html', locals())
|
return render(request,'survey.html', locals())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user