mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2024-11-29 05:11:54 +00:00
[svn r8228] cave maps to all logbook entry trips done there
This commit is contained in:
parent
8068d02734
commit
1f70991566
@ -18,6 +18,7 @@ user.is_superuser = True
|
|||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
import parsers.cavetab
|
import parsers.cavetab
|
||||||
|
parsers.cavetab.LoadCaveTab()
|
||||||
import parsers.people
|
import parsers.people
|
||||||
parsers.people.LoadPersonsExpos()
|
parsers.people.LoadPersonsExpos()
|
||||||
import parsers.logbooks
|
import parsers.logbooks
|
||||||
|
@ -49,18 +49,6 @@ class Expedition(models.Model):
|
|||||||
date+=datetime.timedelta(days=1)
|
date+=datetime.timedelta(days=1)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
# deprecated
|
|
||||||
def GetPersonExpedition(self, name):
|
|
||||||
person_expeditions = PersonExpedition.objects.filter(expedition=self)
|
|
||||||
res = None
|
|
||||||
for person_expedition in person_expeditions:
|
|
||||||
for possible_name_from in person_expedition.GetPossibleNameForms():
|
|
||||||
#print "nnn", possiblenamefrom
|
|
||||||
if name == possible_name_from:
|
|
||||||
assert not res, "Ambiguous: " + name
|
|
||||||
res = person_expedition
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -198,6 +186,7 @@ class CaveAndEntrance(models.Model):
|
|||||||
return unicode(self.cave) + unicode(self.entrance_letter)
|
return unicode(self.cave) + unicode(self.entrance_letter)
|
||||||
|
|
||||||
class Cave(models.Model):
|
class Cave(models.Model):
|
||||||
|
# too much here perhaps
|
||||||
official_name = models.CharField(max_length=160)
|
official_name = models.CharField(max_length=160)
|
||||||
area = models.ManyToManyField(Area, blank=True, null=True)
|
area = models.ManyToManyField(Area, blank=True, null=True)
|
||||||
kataster_code = models.CharField(max_length=20,blank=True,null=True)
|
kataster_code = models.CharField(max_length=20,blank=True,null=True)
|
||||||
@ -216,6 +205,18 @@ class Cave(models.Model):
|
|||||||
depth = models.CharField(max_length=100,blank=True,null=True)
|
depth = models.CharField(max_length=100,blank=True,null=True)
|
||||||
extent = models.CharField(max_length=100,blank=True,null=True)
|
extent = models.CharField(max_length=100,blank=True,null=True)
|
||||||
survex_file = models.CharField(max_length=100,blank=True,null=True) #should be filefield, need to fix parser first
|
survex_file = models.CharField(max_length=100,blank=True,null=True) #should be filefield, need to fix parser first
|
||||||
|
|
||||||
|
href = models.CharField(max_length=100)
|
||||||
|
|
||||||
|
def Sethref(self):
|
||||||
|
if self.kataster_number:
|
||||||
|
self.href = self.kataster_number
|
||||||
|
elif self.unofficial_number:
|
||||||
|
self.href = self.unofficial_number
|
||||||
|
else:
|
||||||
|
self.href = official_name.lower()
|
||||||
|
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
if self.kataster_number:
|
if self.kataster_number:
|
||||||
if self.kat_area():
|
if self.kat_area():
|
||||||
@ -227,6 +228,8 @@ class Cave(models.Model):
|
|||||||
return self.kat_area() + u": " + self.unofficial_number
|
return self.kat_area() + u": " + self.unofficial_number
|
||||||
else:
|
else:
|
||||||
return self.unofficial_number
|
return self.unofficial_number
|
||||||
|
|
||||||
|
|
||||||
def kat_area(self):
|
def kat_area(self):
|
||||||
for a in self.area.all():
|
for a in self.area.all():
|
||||||
if a.kat_area():
|
if a.kat_area():
|
||||||
@ -271,12 +274,15 @@ class LogbookEntry(models.Model):
|
|||||||
text = models.TextField()
|
text = models.TextField()
|
||||||
href = models.CharField(max_length=100)
|
href = models.CharField(max_length=100)
|
||||||
|
|
||||||
|
# turn these into functions
|
||||||
logbookentry_next = models.ForeignKey('LogbookEntry', related_name='pnext', blank=True,null=True)
|
logbookentry_next = models.ForeignKey('LogbookEntry', related_name='pnext', blank=True,null=True)
|
||||||
logbookentry_prev = models.ForeignKey('LogbookEntry', related_name='pprev', blank=True,null=True)
|
logbookentry_prev = models.ForeignKey('LogbookEntry', related_name='pprev', blank=True,null=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name_plural = "Logbook Entries"
|
verbose_name_plural = "Logbook Entries"
|
||||||
# several PersonTrips point in to this object
|
# several PersonTrips point in to this object
|
||||||
|
class Meta:
|
||||||
|
ordering = ('-date',)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return "%s: (%s)" % (self.date, self.title)
|
return "%s: (%s)" % (self.date, self.title)
|
||||||
@ -287,6 +293,7 @@ class PersonTrip(models.Model):
|
|||||||
# this will be a foreign key of the place(s) the trip went through
|
# this will be a foreign key of the place(s) the trip went through
|
||||||
# possibly a trip has a plurality of triplets pointing into it
|
# possibly a trip has a plurality of triplets pointing into it
|
||||||
place = models.CharField(max_length=100)
|
place = models.CharField(max_length=100)
|
||||||
|
# should add cave thing here (copied from logbook maybe)
|
||||||
date = models.DateField()
|
date = models.DateField()
|
||||||
time_underground = models.FloatField()
|
time_underground = models.FloatField()
|
||||||
logbook_entry = models.ForeignKey(LogbookEntry)
|
logbook_entry = models.ForeignKey(LogbookEntry)
|
||||||
@ -474,3 +481,5 @@ class Survey(models.Model):
|
|||||||
|
|
||||||
def elevations(self):
|
def elevations(self):
|
||||||
return self.scannedimage_set.filter(contents='elevation')
|
return self.scannedimage_set.filter(contents='elevation')
|
||||||
|
|
||||||
|
|
@ -7,13 +7,20 @@ import search
|
|||||||
|
|
||||||
def caveindex(request):
|
def caveindex(request):
|
||||||
caves = Cave.objects.all()
|
caves = Cave.objects.all()
|
||||||
return render_to_response('caveindex.html', {'caves': caves, 'settings': settings})
|
notablecavehrefs = [ "161", "204", "258", "76" ]
|
||||||
|
notablecaves = [ Cave.objects.get(href=href) for href in notablecavehrefs ]
|
||||||
|
return render_to_response('caveindex.html', {'caves': caves, 'notablecaves':notablecaves, 'settings': settings})
|
||||||
|
|
||||||
def cave(request, cave_id):
|
def cave(request, cave_id):
|
||||||
#hm, we're only choosing by the number within kataster, needs to be fixed. Caves in 1626 will presumably not work. - AC 7DEC08
|
#hm, we're only choosing by the number within kataster, needs to be fixed. Caves in 1626 will presumably not work. - AC 7DEC08
|
||||||
cave = Cave.objects.filter(kataster_number = cave_id)[0]
|
cave = Cave.objects.filter(kataster_number = cave_id)[0]
|
||||||
return render_to_response('cave.html', {'cave': cave, 'settings': settings})
|
return render_to_response('cave.html', {'cave': cave, 'settings': settings})
|
||||||
|
|
||||||
|
def cavehref(request, href):
|
||||||
|
cave = Cave.objects.get(href=href)
|
||||||
|
return render_to_response('cave.html', {'cave': cave, 'settings': settings})
|
||||||
|
|
||||||
|
|
||||||
def ent(request, cave_id, ent_letter):
|
def ent(request, cave_id, ent_letter):
|
||||||
cave = Cave.objects.filter(kataster_number = cave_id)[0]
|
cave = Cave.objects.filter(kataster_number = cave_id)[0]
|
||||||
cave_and_ent = CaveAndEntrance.objects.filter(cave = cave).filter(entrance_letter = ent_letter)[0]
|
cave_and_ent = CaveAndEntrance.objects.filter(cave = cave).filter(entrance_letter = ent_letter)[0]
|
||||||
|
@ -149,7 +149,7 @@ table.survexcontibutions td.roles
|
|||||||
table.survexcontibutions td.survexblock
|
table.survexcontibutions td.survexblock
|
||||||
{ width:260px; background-color:#feeeed; }
|
{ width:260px; background-color:#feeeed; }
|
||||||
table.survexcontibutions td.trip
|
table.survexcontibutions td.trip
|
||||||
{ width:190px; }
|
{ width:280px; }
|
||||||
table.survexcontibutions td.place
|
table.survexcontibutions td.place
|
||||||
{ width:140px; }
|
{ width:140px; }
|
||||||
|
|
||||||
|
@ -56,9 +56,6 @@ MarkingComment = 43
|
|||||||
Findability = 44
|
Findability = 44
|
||||||
FindabilityComment = 45
|
FindabilityComment = 45
|
||||||
|
|
||||||
cavetab = open(os.path.join(settings.EXPOWEB, "noinfo", "CAVETAB2.CSV"))
|
|
||||||
caveReader = csv.reader(cavetab)
|
|
||||||
caveReader.next() # Strip out column headers
|
|
||||||
|
|
||||||
def html_to_wiki(text):
|
def html_to_wiki(text):
|
||||||
if type(text) != str:
|
if type(text) != str:
|
||||||
@ -138,130 +135,137 @@ def html_to_wiki(text):
|
|||||||
text2 = ""
|
text2 = ""
|
||||||
return out
|
return out
|
||||||
|
|
||||||
for katArea in ['1623', '1626']:
|
def LoadCaveTab():
|
||||||
if not models.Area.objects.filter(short_name = katArea):
|
cavetab = open(os.path.join(settings.EXPOWEB, "noinfo", "CAVETAB2.CSV"))
|
||||||
newArea = models.Area(short_name = katArea)
|
caveReader = csv.reader(cavetab)
|
||||||
newArea.save()
|
caveReader.next() # Strip out column headers
|
||||||
area1626 = models.Area.objects.filter(short_name = '1626')[0]
|
|
||||||
area1623 = models.Area.objects.filter(short_name = '1623')[0]
|
|
||||||
|
|
||||||
counter=0
|
for katArea in ['1623', '1626']:
|
||||||
for line in caveReader :
|
if not models.Area.objects.filter(short_name = katArea):
|
||||||
if line[Area] == 'nonexistent':
|
newArea = models.Area(short_name = katArea)
|
||||||
continue
|
newArea.save()
|
||||||
entranceLetters=[] #Used in caves that have mulitlple entrances, which are not described on seperate lines
|
area1626 = models.Area.objects.filter(short_name = '1626')[0]
|
||||||
if line[MultipleEntrances] == 'yes' or line[MultipleEntrances]=='':
|
area1623 = models.Area.objects.filter(short_name = '1623')[0]
|
||||||
args = {}
|
|
||||||
def addToArgs(CSVname, modelName):
|
|
||||||
if line[CSVname]:
|
|
||||||
args[modelName] = html_to_wiki(line[CSVname])
|
|
||||||
addToArgs(KatasterNumber, "kataster_number")
|
|
||||||
addToArgs(KatStatusCode, "kataster_code")
|
|
||||||
addToArgs(UnofficialNumber, "unofficial_number")
|
|
||||||
addToArgs(Name, "official_name")
|
|
||||||
addToArgs(Comment, "notes")
|
|
||||||
addToArgs(Explorers, "explorers")
|
|
||||||
addToArgs(UndergroundDescription, "underground_description")
|
|
||||||
addToArgs(Equipment, "equipment")
|
|
||||||
addToArgs(KatasterStatus, "kataster_status")
|
|
||||||
addToArgs(References, "references")
|
|
||||||
addToArgs(UndergroundCentreLine, "underground_centre_line")
|
|
||||||
addToArgs(UndergroundDrawnSurvey, "survey")
|
|
||||||
addToArgs(Length, "length")
|
|
||||||
addToArgs(Depth, "depth")
|
|
||||||
addToArgs(Extent, "extent")
|
|
||||||
addToArgs(SurvexFile, "survex_file")
|
|
||||||
addToArgs(Notes, "notes")
|
|
||||||
|
|
||||||
newCave = models.Cave(**args)
|
counter=0
|
||||||
newCave.save()
|
for line in caveReader :
|
||||||
|
if line[Area] == 'nonexistent':
|
||||||
|
continue
|
||||||
|
entranceLetters=[] #Used in caves that have mulitlple entrances, which are not described on seperate lines
|
||||||
|
if line[MultipleEntrances] == 'yes' or line[MultipleEntrances]=='':
|
||||||
|
args = {}
|
||||||
|
def addToArgs(CSVname, modelName):
|
||||||
|
if line[CSVname]:
|
||||||
|
args[modelName] = html_to_wiki(line[CSVname])
|
||||||
|
addToArgs(KatasterNumber, "kataster_number")
|
||||||
|
addToArgs(KatStatusCode, "kataster_code")
|
||||||
|
addToArgs(UnofficialNumber, "unofficial_number")
|
||||||
|
addToArgs(Name, "official_name")
|
||||||
|
addToArgs(Comment, "notes")
|
||||||
|
addToArgs(Explorers, "explorers")
|
||||||
|
addToArgs(UndergroundDescription, "underground_description")
|
||||||
|
addToArgs(Equipment, "equipment")
|
||||||
|
addToArgs(KatasterStatus, "kataster_status")
|
||||||
|
addToArgs(References, "references")
|
||||||
|
addToArgs(UndergroundCentreLine, "underground_centre_line")
|
||||||
|
addToArgs(UndergroundDrawnSurvey, "survey")
|
||||||
|
addToArgs(Length, "length")
|
||||||
|
addToArgs(Depth, "depth")
|
||||||
|
addToArgs(Extent, "extent")
|
||||||
|
addToArgs(SurvexFile, "survex_file")
|
||||||
|
addToArgs(Notes, "notes")
|
||||||
|
|
||||||
if line[Area]:
|
newCave = models.Cave(**args)
|
||||||
if line[Area] == "1626":
|
newCave.Sethref()
|
||||||
newCave.area.add(area1626)
|
newCave.save()
|
||||||
else:
|
|
||||||
area = models.Area.objects.filter(short_name = line[Area])
|
if line[Area]:
|
||||||
if area:
|
if line[Area] == "1626":
|
||||||
newArea = area[0]
|
newCave.area.add(area1626)
|
||||||
else:
|
else:
|
||||||
newArea = models.Area(short_name = line[Area], parent = area1623)
|
area = models.Area.objects.filter(short_name = line[Area])
|
||||||
newArea.save()
|
if area:
|
||||||
newCave.area.add(newArea)
|
newArea = area[0]
|
||||||
else:
|
else:
|
||||||
newCave.area.add(area1623)
|
newArea = models.Area(short_name = line[Area], parent = area1623)
|
||||||
|
newArea.save()
|
||||||
|
newCave.area.add(newArea)
|
||||||
|
else:
|
||||||
|
newCave.area.add(area1623)
|
||||||
|
|
||||||
newCave.save()
|
newCave.save()
|
||||||
|
|
||||||
if line[UnofficialName]:
|
if line[UnofficialName]:
|
||||||
newUnofficialName = models.OtherCaveName(cave = newCave, name = line[UnofficialName])
|
newUnofficialName = models.OtherCaveName(cave = newCave, name = line[UnofficialName])
|
||||||
newUnofficialName.save()
|
newUnofficialName.save()
|
||||||
if line[MultipleEntrances] == '' or \
|
|
||||||
line[MultipleEntrances] == 'entrance' or \
|
|
||||||
line[MultipleEntrances] == 'last entrance':
|
|
||||||
args = {}
|
|
||||||
def addToArgs(CSVname, modelName):
|
|
||||||
if line[CSVname]:
|
|
||||||
args[modelName] = html_to_wiki(line[CSVname])
|
|
||||||
def addToArgsViaDict(CSVname, modelName, dictionary):
|
|
||||||
if line[CSVname]:
|
|
||||||
args[modelName] = dictionary[html_to_wiki(line[CSVname])]
|
|
||||||
addToArgs(EntranceName, 'name')
|
|
||||||
addToArgs(Explorers, 'explorers')
|
|
||||||
addToArgs(Map, 'map_description')
|
|
||||||
addToArgs(Location, 'location_description')
|
|
||||||
addToArgs(Approach, 'approach')
|
|
||||||
addToArgs(EntranceDescription, 'entrance_description')
|
|
||||||
addToArgs(UndergroundDescription, 'underground_description')
|
|
||||||
addToArgs(PhotoOfLocation, 'photo')
|
|
||||||
addToArgsViaDict(Marking, 'marking', {"Paint": "P",
|
|
||||||
"Paint (?)": "P?",
|
|
||||||
"Tag": "T",
|
|
||||||
"Tag (?)": "T?",
|
|
||||||
"Retagged": "R",
|
|
||||||
"Retag": "R",
|
|
||||||
"Spit": "S",
|
|
||||||
"Spit (?)": "S?",
|
|
||||||
"Unmarked": "U",
|
|
||||||
"": "?",
|
|
||||||
})
|
|
||||||
addToArgs(MarkingComment, 'marking_comment')
|
|
||||||
addToArgsViaDict(Findability, 'findability', {"Surveyed": "S",
|
|
||||||
"Lost": "L",
|
|
||||||
"Refindable": "R",
|
|
||||||
"": "?",
|
|
||||||
"?": "?",
|
|
||||||
})
|
|
||||||
addToArgs(FindabilityComment, 'findability_description')
|
|
||||||
addToArgs(Easting, 'easting')
|
|
||||||
addToArgs(Northing, 'northing')
|
|
||||||
addToArgs(Altitude, 'alt')
|
|
||||||
addToArgs(DescriptionOfOtherPoint, 'other_description')
|
|
||||||
def addToArgsSurveyStation(CSVname, modelName):
|
|
||||||
if line[CSVname]:
|
|
||||||
surveyPoint = models.SurveyStation(name = line[CSVname])
|
|
||||||
surveyPoint.save()
|
|
||||||
args[modelName] = html_to_wiki(surveyPoint)
|
|
||||||
addToArgsSurveyStation(TagPoint, 'tag_station')
|
|
||||||
addToArgsSurveyStation(ExactEntrance, 'exact_station')
|
|
||||||
addToArgsSurveyStation(OtherPoint, 'other_station')
|
|
||||||
addToArgs(OtherPoint, 'other_description')
|
|
||||||
if line[GPSpreSA]:
|
|
||||||
addToArgsSurveyStation(GPSpreSA, 'other_station')
|
|
||||||
args['other_description'] = 'pre selective availability GPS'
|
|
||||||
if line[GPSpostSA]:
|
|
||||||
addToArgsSurveyStation(GPSpostSA, 'other_station')
|
|
||||||
args['other_description'] = 'post selective availability GPS'
|
|
||||||
addToArgs(Bearings, 'bearings')
|
|
||||||
newEntrance = models.Entrance(**args)
|
|
||||||
newEntrance.save()
|
|
||||||
|
|
||||||
if line[Entrances]:
|
if line[MultipleEntrances] == '' or \
|
||||||
entrance_letter = line[Entrances]
|
line[MultipleEntrances] == 'entrance' or \
|
||||||
else:
|
line[MultipleEntrances] == 'last entrance':
|
||||||
entrance_letter = ''
|
args = {}
|
||||||
|
def addToArgs(CSVname, modelName):
|
||||||
|
if line[CSVname]:
|
||||||
|
args[modelName] = html_to_wiki(line[CSVname])
|
||||||
|
def addToArgsViaDict(CSVname, modelName, dictionary):
|
||||||
|
if line[CSVname]:
|
||||||
|
args[modelName] = dictionary[html_to_wiki(line[CSVname])]
|
||||||
|
addToArgs(EntranceName, 'name')
|
||||||
|
addToArgs(Explorers, 'explorers')
|
||||||
|
addToArgs(Map, 'map_description')
|
||||||
|
addToArgs(Location, 'location_description')
|
||||||
|
addToArgs(Approach, 'approach')
|
||||||
|
addToArgs(EntranceDescription, 'entrance_description')
|
||||||
|
addToArgs(UndergroundDescription, 'underground_description')
|
||||||
|
addToArgs(PhotoOfLocation, 'photo')
|
||||||
|
addToArgsViaDict(Marking, 'marking', {"Paint": "P",
|
||||||
|
"Paint (?)": "P?",
|
||||||
|
"Tag": "T",
|
||||||
|
"Tag (?)": "T?",
|
||||||
|
"Retagged": "R",
|
||||||
|
"Retag": "R",
|
||||||
|
"Spit": "S",
|
||||||
|
"Spit (?)": "S?",
|
||||||
|
"Unmarked": "U",
|
||||||
|
"": "?",
|
||||||
|
})
|
||||||
|
addToArgs(MarkingComment, 'marking_comment')
|
||||||
|
addToArgsViaDict(Findability, 'findability', {"Surveyed": "S",
|
||||||
|
"Lost": "L",
|
||||||
|
"Refindable": "R",
|
||||||
|
"": "?",
|
||||||
|
"?": "?",
|
||||||
|
})
|
||||||
|
addToArgs(FindabilityComment, 'findability_description')
|
||||||
|
addToArgs(Easting, 'easting')
|
||||||
|
addToArgs(Northing, 'northing')
|
||||||
|
addToArgs(Altitude, 'alt')
|
||||||
|
addToArgs(DescriptionOfOtherPoint, 'other_description')
|
||||||
|
def addToArgsSurveyStation(CSVname, modelName):
|
||||||
|
if line[CSVname]:
|
||||||
|
surveyPoint = models.SurveyStation(name = line[CSVname])
|
||||||
|
surveyPoint.save()
|
||||||
|
args[modelName] = html_to_wiki(surveyPoint)
|
||||||
|
addToArgsSurveyStation(TagPoint, 'tag_station')
|
||||||
|
addToArgsSurveyStation(ExactEntrance, 'exact_station')
|
||||||
|
addToArgsSurveyStation(OtherPoint, 'other_station')
|
||||||
|
addToArgs(OtherPoint, 'other_description')
|
||||||
|
if line[GPSpreSA]:
|
||||||
|
addToArgsSurveyStation(GPSpreSA, 'other_station')
|
||||||
|
args['other_description'] = 'pre selective availability GPS'
|
||||||
|
if line[GPSpostSA]:
|
||||||
|
addToArgsSurveyStation(GPSpostSA, 'other_station')
|
||||||
|
args['other_description'] = 'post selective availability GPS'
|
||||||
|
addToArgs(Bearings, 'bearings')
|
||||||
|
newEntrance = models.Entrance(**args)
|
||||||
|
newEntrance.save()
|
||||||
|
|
||||||
newCaveAndEntrance = models.CaveAndEntrance(cave = newCave, entrance = newEntrance, entrance_letter = entrance_letter)
|
if line[Entrances]:
|
||||||
newCaveAndEntrance.save()
|
entrance_letter = line[Entrances]
|
||||||
|
else:
|
||||||
|
entrance_letter = ''
|
||||||
|
|
||||||
|
newCaveAndEntrance = models.CaveAndEntrance(cave = newCave, entrance = newEntrance, entrance_letter = entrance_letter)
|
||||||
|
newCaveAndEntrance.save()
|
||||||
|
|
||||||
|
|
||||||
# lookup function modelled on GetPersonExpeditionNameLookup
|
# lookup function modelled on GetPersonExpeditionNameLookup
|
||||||
@ -277,6 +281,9 @@ def GetCaveLookup():
|
|||||||
Gcavelookup[cave.kataster_number] = cave
|
Gcavelookup[cave.kataster_number] = cave
|
||||||
if cave.unofficial_number:
|
if cave.unofficial_number:
|
||||||
Gcavelookup[cave.unofficial_number] = cave
|
Gcavelookup[cave.unofficial_number] = cave
|
||||||
|
|
||||||
|
Gcavelookup["tunnocks"] = Gcavelookup["258"]
|
||||||
|
Gcavelookup["hauchhole"] = Gcavelookup["234"]
|
||||||
return Gcavelookup
|
return Gcavelookup
|
||||||
|
|
||||||
|
|
@ -63,13 +63,16 @@ def GetTripCave(place): #need to be fuzzier about matching h
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
noncaveplaces = [ "Journey", "Loser Plateau" ]
|
||||||
def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_underground):
|
def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_underground):
|
||||||
trippersons, author = GetTripPersons(trippeople, expedition, logtime_underground)
|
trippersons, author = GetTripPersons(trippeople, expedition, logtime_underground)
|
||||||
# tripCave = GetTripCave(place)
|
# tripCave = GetTripCave(place)
|
||||||
|
|
||||||
lbo = models.LogbookEntry(date=date, place=place, title=title[:50], text=text, author=author, expedition=expedition)
|
lbo = models.LogbookEntry(date=date, place=place, title=title[:50], text=text, author=author, expedition=expedition)
|
||||||
lbo.cave=GetCaveLookup().get(place)
|
lplace = place.lower()
|
||||||
print "pppp", place, lbo.cave
|
if lplace not in noncaveplaces:
|
||||||
|
lbo.cave=GetCaveLookup().get(lplace)
|
||||||
|
print "pppp %s |%s|" % (lplace, str(lbo.cave))
|
||||||
|
|
||||||
lbo.save()
|
lbo.save()
|
||||||
#print "ttt", date, place
|
#print "ttt", date, place
|
||||||
@ -158,7 +161,7 @@ def Parseloghtml01(year, expedition, txt):
|
|||||||
tripid = mtripid and mtripid.group(1) or ""
|
tripid = mtripid and mtripid.group(1) or ""
|
||||||
tripheader = re.sub("</?(?:[ab]|span)[^>]*>", "", tripheader)
|
tripheader = re.sub("</?(?:[ab]|span)[^>]*>", "", tripheader)
|
||||||
|
|
||||||
print [tripheader]
|
#print [tripheader]
|
||||||
#continue
|
#continue
|
||||||
|
|
||||||
tripdate, triptitle, trippeople = tripheader.split("|")
|
tripdate, triptitle, trippeople = tripheader.split("|")
|
||||||
|
@ -2,6 +2,19 @@
|
|||||||
{% load wiki_markup %}
|
{% load wiki_markup %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
<div id="col2">
|
||||||
|
<h3>All trips done in this cave</h3>
|
||||||
|
<table>
|
||||||
|
{% for logbookentry in cave.logbookentry_set.all %}
|
||||||
|
<tr>
|
||||||
|
<td>{{logbookentry.date}}</td>
|
||||||
|
<td><a href="{% url logbookentry logbookentry.href %}">{{logbookentry.title|safe}}</a></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if cave.entrances %}
|
{% if cave.entrances %}
|
||||||
<h2>Entrances</h2>
|
<h2>Entrances</h2>
|
||||||
{% for ent in cave.entrances %}
|
{% for ent in cave.entrances %}
|
||||||
|
@ -4,7 +4,19 @@
|
|||||||
{% block title %}Cave Index{% endblock %}
|
{% block title %}Cave Index{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% for cave in caves %}
|
|
||||||
<p>{{ cave }} <a href="{{settings.URL_ROOT}}cave/{{ cave.kataster_number }}/">{{ cave.official_name|wiki_to_html_short }}</a> </p>
|
<h3>Notable caves</h3>
|
||||||
|
<ul>
|
||||||
|
{% for cave in notablecaves %}
|
||||||
|
<li> <a href="{% url cave cave.href %}">{{cave.official_name|wiki_to_html_short}} ({{cave.href}})</a> </li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>All caves</h3>
|
||||||
|
<ul>
|
||||||
|
{% for cave in caves %}
|
||||||
|
<li> <a href="{% url cave cave.href %}">{{cave.official_name|wiki_to_html_short}} ({{cave.href}})</a> </li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -38,7 +38,12 @@
|
|||||||
<td>{{logbookentry.date}}</td>
|
<td>{{logbookentry.date}}</td>
|
||||||
<td><a href="{% url logbookentry logbookentry.href %}">{{logbookentry.title|safe}}</td>
|
<td><a href="{% url logbookentry logbookentry.href %}">{{logbookentry.title|safe}}</td>
|
||||||
<td><a href="{% url personexpedition logbookentry.author.person.href logbookentry.author.expedition.year %}">{{logbookentry.author.name}}</a></td>
|
<td><a href="{% url personexpedition logbookentry.author.person.href logbookentry.author.expedition.year %}">{{logbookentry.author.name}}</a></td>
|
||||||
<td>{{logbookentry.place}}</td>
|
|
||||||
|
{% if logbookentry.cave %}
|
||||||
|
<td><a href="{% url cave logbookentry.cave.href %}">{{logbookentry.place}}</a></td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{logbookentry.place}}</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -9,26 +9,25 @@
|
|||||||
<b>Work down through an expedition page link</b>
|
<b>Work down through an expedition page link</b>
|
||||||
<p class="indent"><b>Remaining work:</b>
|
<p class="indent"><b>Remaining work:</b>
|
||||||
|
|
||||||
<p>continue to build up the network; </p>
|
<p>(separate out the recent/notable people) vast front-page layout table of folks and caving trips and years; </p>
|
||||||
<p>tables of trips per year per person;</p>
|
|
||||||
<p>parse 1995-1976 logbooks; </p>
|
<p>parse 1995-1976 logbooks; </p>
|
||||||
<p>continue to correct the name matching and spelling; </p>
|
<p>name matching and spelling in survex files; </p>
|
||||||
<p>detect T/U on log entries; </p>
|
<p>detect T/U on log entries; </p>
|
||||||
|
<p>Improve logbook wikihtml text</p>
|
||||||
<p>match caves to log entries; </p>
|
<p>match caves to log entries; </p>
|
||||||
<p>see the cave list;</p>
|
|
||||||
<p>simplify the survex parsing code (if necessary); </p>
|
<p>simplify the survex parsing code (if necessary); </p>
|
||||||
<p>vast front-page layout table of folks and caving trips and years; </p>
|
|
||||||
<p>links between logbooks and survex blocks to cave things; </p>
|
<p>links between logbooks and survex blocks to cave things; </p>
|
||||||
<p>where are the subcaves; </p>
|
<p>where are the subcaves; </p>
|
||||||
<p>mini-tree of survexblocks; </p>
|
<p>mini-tree of survexblocks; </p>
|
||||||
<p>connect sketches to caves to survey blocks and render thumbnailwise; </p>
|
<p>connect sketches to caves to survey blocks and render thumbnailwise; </p>
|
||||||
<p>all images to start appearing in pages; and so on</p>
|
<p>all images to start appearing in pages; and so on</p>
|
||||||
|
<p>tables of trips per year per person;</p>
|
||||||
|
|
||||||
<h3>{{message}}</h3>
|
<h3>{{message}}</h3>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{% url personindex %}">List of People</a></li>
|
<li><b><a href="{% url personindex %}">List of People</a></b></li>
|
||||||
<li><a href="{% url caveindex %}">List of Caves</a></li>
|
<li><b><a href="{% url caveindex %}">List of Caves</a></b></li>
|
||||||
<li><a href="/statistics">Statistics of what's loaded in the database</a></li>
|
<li><a href="/statistics">Statistics of what's loaded in the database</a></li>
|
||||||
<li><a href="{% url survexindex all %}">Survex directory</a></li>
|
<li><a href="{% url survexindex all %}">Survex directory</a></li>
|
||||||
<li><a href="{% url survey %}">Survey files</a></li>
|
<li><a href="{% url survey %}">Survey files</a></li>
|
||||||
@ -40,13 +39,11 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<ul id="expeditionlist">
|
<ul id="expeditionlist">
|
||||||
|
{% for expedition in expeditions %}
|
||||||
{% for expedition in expeditions %}
|
<li>
|
||||||
<li>
|
<a href="{% url expedition expedition.year %}">{{expedition.name}}</a>
|
||||||
<a href="{% url expedition expedition.year %}">{{expedition.name}}</a>
|
</li>
|
||||||
</li>
|
{% endfor %}
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -8,7 +8,12 @@
|
|||||||
|
|
||||||
<div id="col2">
|
<div id="col2">
|
||||||
<p><a href="{% url expedition logbookentry.expedition.year %}">{{logbookentry.expedition.name}}</a></p>
|
<p><a href="{% url expedition logbookentry.expedition.year %}">{{logbookentry.expedition.name}}</a></p>
|
||||||
<p>place: {{logbookentry.place}}</p>
|
|
||||||
|
{% if logbookentry.cave %}
|
||||||
|
<p>place: <a href="{% url cave logbookentry.cave.href %}">{{logbookentry.place}}</p>
|
||||||
|
{% else %}
|
||||||
|
<p>{{logbookentry.place}}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% if logbookentry.logbookentry_prev %}
|
{% if logbookentry.logbookentry_prev %}
|
||||||
|
@ -36,7 +36,12 @@
|
|||||||
{% for persontrip in persondate.1.persontrips %}
|
{% for persontrip in persondate.1.persontrips %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="trip"><a href="{% url logbookentry persontrip.logbook_entry.href %}">{{persontrip.logbook_entry.title|safe}}</a></td>
|
<td class="trip"><a href="{% url logbookentry persontrip.logbook_entry.href %}">{{persontrip.logbook_entry.title|safe}}</a></td>
|
||||||
<td class="place">{{persontrip.place}}</td>
|
|
||||||
|
{% if persontrip.logbook_entry.cave %}
|
||||||
|
<td><a href="{% url cave persontrip.logbook_entry.cave.href %}">{{persontrip.place}}</a></td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{persontrip.place}}</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -9,8 +9,10 @@ urlpatterns = patterns('',
|
|||||||
|
|
||||||
(r'^$', frontPage),
|
(r'^$', frontPage),
|
||||||
url(r'^caveindex$', caveindex, name="caveindex"),
|
url(r'^caveindex$', caveindex, name="caveindex"),
|
||||||
|
url(r'^cave/(?P<cave_id>[^/]+)/?$', cave),
|
||||||
|
|
||||||
|
url(r'^cavehref/(.+)$', cave, name="cave"),
|
||||||
|
|
||||||
(r'^cave/(?P<cave_id>[^/]+)/?$', cave),
|
|
||||||
(r'^cave/(?P<cave_id>[^/]+)/?(?P<ent_letter>[^/])$', ent),
|
(r'^cave/(?P<cave_id>[^/]+)/?(?P<ent_letter>[^/])$', ent),
|
||||||
#(r'^cave/(?P<cave_id>[^/]+)/edit/$', edit_cave),
|
#(r'^cave/(?P<cave_id>[^/]+)/edit/$', edit_cave),
|
||||||
(r'^cavesearch', caveSearch),
|
(r'^cavesearch', caveSearch),
|
||||||
|
@ -282,7 +282,7 @@ FRIDAY 28th JULY
|
|||||||
OOPS!
|
OOPS!
|
||||||
|
|
||||||
|
|
||||||
===24/7/06 | Tunnocks Trips | Tom, Mark, Aaron ===
|
===24/7/06 | Tunnocks - Trips | Tom, Mark, Aaron ===
|
||||||
|
|
||||||
<p> BECKA - actually three dates given: 24,25,26 July
|
<p> BECKA - actually three dates given: 24,25,26 July
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user