diff --git a/aaussee/0.htm b/aaussee/0.htm index c91ef95c2..4abaa624b 100644 --- a/aaussee/0.htm +++ b/aaussee/0.htm @@ -6,7 +6,7 @@
A walk around Altausseer See reveals few streams flowing in to the lake, but a sizeable river flowing out, fuelling speculation that there were diff --git a/troggle/expo/models.py b/troggle/expo/models.py index 3cc0492cc..ebaf9abc3 100644 --- a/troggle/expo/models.py +++ b/troggle/expo/models.py @@ -45,6 +45,8 @@ class Person(models.Model): is_vfho = models.BooleanField(help_text="VFHO is the Vereines für Höhlenkunde in Obersteier, a nearby Austrian caving club.") mug_shot = models.CharField(max_length=100, blank=True,null=True) blurb = models.TextField(blank=True,null=True) + href = models.CharField(max_length=200) + class Meta: verbose_name_plural = "People" @@ -53,12 +55,6 @@ class Person(models.Model): return "%s %s" % (self.first_name, self.last_name) return self.first_name - # this should be a member entry - def href(self): - if self.last_name: - return "%s_%s" % (self.first_name.lower(), self.last_name.lower()) - return self.first_name.lower() - class PersonExpedition(models.Model): expedition = models.ForeignKey(Expedition) @@ -205,9 +201,10 @@ class LogbookEntry(models.Model): expedition = models.ForeignKey(Expedition,blank=True,null=True) # yes this is double- author = models.ForeignKey(PersonExpedition,blank=True,null=True) # the person who writes it up doesn't have to have been on the trip title = models.CharField(max_length=200) - cave = models.ForeignKey(Cave,blank=True,null=True) + cave = models.ForeignKey(Cave,blank=True,null=True) place = models.CharField(max_length=100,blank=True,null=True) text = models.TextField() + href = models.CharField(max_length=100) logbookentry_next = models.ForeignKey('LogbookEntry', related_name='pnext', blank=True,null=True) logbookentry_prev = models.ForeignKey('LogbookEntry', related_name='pprev', blank=True,null=True) diff --git a/troggle/expo/models_survex.py b/troggle/expo/models_survex.py index da8ec88ed..80e5f5b6c 100644 --- a/troggle/expo/models_survex.py +++ b/troggle/expo/models_survex.py @@ -1,5 +1,6 @@ from django.db import models - +import troggle.settings as settings +import os class SurvexBlock(models.Model): name = models.CharField(max_length=100, blank=True, null=True) @@ -11,15 +12,28 @@ class SurvexBlock(models.Model): end_year = models.IntegerField(blank=True, null=True) end_month = models.IntegerField(blank=True, null=True) end_day = models.IntegerField(blank=True, null=True) + person = models.ManyToManyField('Person', through='PersonRole', blank=True, null=True) + begin_file = models.CharField(max_length=200) begin_char = models.IntegerField() end_file = models.CharField(max_length=200, blank=True, null=True) end_char = models.IntegerField(blank=True, null=True) + def __unicode__(self): return unicode(self.name) + + def filecontents(self): + f = os.path.join(settings.SURVEX_DATA, self.begin_file) + fin = open(f) + res = fin.read() + fin.close() + return res + + class PersonRole(models.Model): + personexpedition = models.ForeignKey('PersonExpedition') person = models.ForeignKey('Person') survex_block = models.ForeignKey('SurvexBlock') role = models.ForeignKey('Role') diff --git a/troggle/expo/views_logbooks.py b/troggle/expo/views_logbooks.py index 1f3de2318..935eebd03 100644 --- a/troggle/expo/views_logbooks.py +++ b/troggle/expo/views_logbooks.py @@ -22,17 +22,19 @@ def expedition(request, expeditionname): return render_to_response('expedition.html', {'expedition': expedition, 'expedition_next':expedition_next, 'expedition_prev':expedition_prev, 'logbookentries':logbookentries, 'message':message, 'settings': settings}) def person(request, name): - persons = Person.objects.all() - for person in persons: - if person.href() == name: - break - person = None + person = Person.objects.get(href=name) return render_to_response('person.html', {'person': person, 'settings': settings}) +def personexpedition(request, name, expeditionname): + person = Person.objects.get(href=name) + year = int(expeditionname) + expedition = Expedition.objects.get(year=year) + personexpedition = person.personexpedition_set.get(expedition=expedition) + return render_to_response('personexpedition.html', {'personexpedition': personexpedition, 'settings': settings}) + + def logbookentry(request, logbookentry_id): - logbookentry = LogbookEntry.objects.filter(id = logbookentry_id)[0] - - + logbookentry = LogbookEntry.objects.filter(href = logbookentry_id)[0] return render_to_response('logbookentry.html', {'logbookentry': logbookentry, 'settings': settings}) diff --git a/troggle/parsers/logbooks.py b/troggle/parsers/logbooks.py index 53726c646..a2cf58a6f 100644 --- a/troggle/parsers/logbooks.py +++ b/troggle/parsers/logbooks.py @@ -169,10 +169,20 @@ def Parseloghtml01(year, expedition, txt): triptitles = triptitle.split(" - ") tripcave = triptitles[0].strip() - ltriptext = re.sub("
", "", triptext) + ltriptext = triptext + + mtail = re.search('(?:[^<]*|\s|/|-|&|?p>|\((?:same day|\d+)\))*$', ltriptext) + if mtail: + #print mtail.group(0) + ltriptext = ltriptext[:mtail.start(0)] + ltriptext = re.sub("", "", ltriptext) ltriptext = re.sub("\s*?\n\s*", " ", ltriptext) - ltriptext = re.sub("", "\n\n", ltriptext).strip() + ltriptext = re.sub("
|
", "\n\n", ltriptext).strip()
#ltriptext = re.sub("[^\s0-9a-zA-Z\-.,:;'!]", "NONASCII", ltriptext)
+ ltriptext = re.sub("?u>", "_", ltriptext)
+ ltriptext = re.sub("?i>", "''", ltriptext)
+ ltriptext = re.sub("?b>", "'''", ltriptext)
+
#print ldate, trippeople.strip()
# could includ the tripid (url link for cross referencing)
@@ -246,6 +256,28 @@ def SetDatesFromLogbookEntries(expedition):
expedition.date_to = max([personexpedition.date_to for personexpedition in expedition.personexpedition_set.all() if personexpedition.date_to] or [None])
expedition.save()
+ # order by appearance in the logbook (done by id)
+ lprevlogbookentry = None
+ for logbookentry in expedition.logbookentry_set.order_by('id'):
+ logbookentry.logbookentry_prev = lprevlogbookentry
+ if lprevlogbookentry:
+ lprevlogbookentry.logbookentry_next = logbookentry
+ lprevlogbookentry.save()
+ logbookentry.logbookentry_next = None
+ logbookentry.save()
+ lprevlogbookentry = logbookentry
+
+ # order by date for setting the references
+ lprevlogbookentry = None
+ for logbookentry in expedition.logbookentry_set.order_by('date'):
+ if lprevlogbookentry and lprevlogbookentry.date == logbookentry.date:
+ mcount = re.search("_(\d+)$", lprevlogbookentry.href)
+ mc = mcount and (int(mcount.group(1)) + 1) or 1
+ logbookentry.href = "%s_%d" % (logbookentry.date, mc)
+ else:
+ logbookentry.href = "%s" % logbookentry.date
+ logbookentry.save()
+ lprevlogbookentry = logbookentry
def LoadLogbookForExpedition(expedition):
@@ -268,6 +300,7 @@ def LoadLogbooks():
models.LogbookEntry.objects.all().delete()
expowebbase = os.path.join(settings.EXPOWEB, "years")
#yearlinks = [ ("2001", "2001/log.htm", Parseloghtml01), ] #overwrite
+ #yearlinks = [ ("1997", "1997/log.htm", Parseloghtml01),] # overwrite
for year, lloc, parsefunc in yearlinks:
expedition = models.Expedition.objects.filter(year = year)[0]
diff --git a/troggle/parsers/people.py b/troggle/parsers/people.py
index d85d77233..c59d3d88d 100644
--- a/troggle/parsers/people.py
+++ b/troggle/parsers/people.py
@@ -81,8 +81,11 @@ def LoadPersonsExpos():
print firstname, lastname, "NNN", nickname
#assert lastname == person[header[""]], person
+ href = firstname.lower()
+ if lastname:
+ href += "_" + lastname.lower()
pObject = models.Person(first_name = firstname,
- last_name = lastname,
+ last_name = lastname, href=href,
is_vfho = person[header["VfHO member"]],
)
diff --git a/troggle/parsers/survex.py b/troggle/parsers/survex.py
index 00b6254df..1f688c3aa 100644
--- a/troggle/parsers/survex.py
+++ b/troggle/parsers/survex.py
@@ -70,7 +70,8 @@ def make_model(name, parent, iter_lines, sf, c, l):
and names.strip("\t").strip(" ") != "Both"])
for name in re.split("&|/|\+|,|;", names):
try:
- models.PersonRole(person = exp.GetPersonExpedition(name.strip(" ")).person,
+ models.PersonRole(personexpedition = exp.GetPersonExpedition(name.strip(" ")),
+ person = exp.GetPersonExpedition(name.strip(" ")).person,
survex_block = m,
role = models.Role.objects.get(name = roles[role])).save()
except AttributeError:
diff --git a/troggle/templates/expedition.html b/troggle/templates/expedition.html
index 72fec1518..bcbed62c6 100644
--- a/troggle/templates/expedition.html
+++ b/troggle/templates/expedition.html
@@ -18,7 +18,7 @@
{{logbookentry.expedition.name}}
place: {{logbookentry.place}}
++ {% if logbookentry.logbookentry_prev %} + {{logbookentry.logbookentry_prev.date}} + {% endif %} + {% if logbookentry.logbookentry_next %} + {{logbookentry.logbookentry_next.date}} + {% endif %} +
+Caver | T/U | Prev | Next |
---|---|---|---|
+{{persontrip.person_expedition.person.personrole_set.count}} {% else %} | {% endifequal %} @@ -30,12 +40,12 @@ | {% if persontrip.persontrip_prev %} - {{persontrip.persontrip_prev.date}} + {{persontrip.persontrip_prev.date}} {% endif %} | {% if persontrip.persontrip_next %} - {{persontrip.persontrip_next.date}} + {{persontrip.persontrip_next.date}} {% endif %} |
Date | Place | Role |
---|---|---|
{{personrole.survex_block.start_month}} | +{{personrole.survex_block.name}} | +{{personrole.role}} | +
Date | Title | Place |
---|---|---|
{{persontrip.date}} | +{{persontrip.logbook_entry.title|safe}} | +{{persontrip.place}} | +
1/7/96 | Plateau - go looking for 161d | Steve and Anthony
After sitting around at Top Camp for a bit waiting for the weather to clear up, it became clear it wasn't going to so we went entrance hunting. @@ -85,7 +85,7 @@ hasn't been checked out - so what the hell is it??
"Buy a car Nick, it'll be lovely" said Steve.
"Buy a car Nick, it'll be really useful and there are this many reasons
@@ -111,8 +111,7 @@ Gösser, so had to join them.
-3/7/96 Anthony, Gunilla, Matthew, Steve
-Looking for a route to 161d from above
+
3/7/96 | Plateau - Looking for a route to 161d from above | Anthony, Gunilla, Matthew, Steve
After faffing about in the morning whilst Helen tried to sort out the rest of her life via Hilde's phone, we set off to top camp about one o'clock. Then @@ -142,8 +141,8 @@ reasonable pace.
| Looking for a way back to England.... | Helen + Nick
+As we're nearly ready for going to Top Camp to carry stuff Hilda calls me and I get a phonecall from Dad "-you have an interview next week". After @@ -201,7 +200,7 @@ Trips same day finding: Puerile Humour &
4/7 | Carry up | Nick, Matthew, Brian, Phil
Carried lots of shit up to Top Camp in the heat, whilst Steve and Anthony massacred some bunde with Anthony's Junior Hacksaw. Saw a little adder @@ -209,7 +208,7 @@ massacred some bunde with Anthony's Junior Hacksaw. Saw a little adder2/7 | Journey out | Brian & PhilU
Set of from London 3:30am. Folkestone. Chunnel. France. Belgium. Germany. Fly-camp. More Germany. Austria. Base Camp. Top Camp. 50mph. 'Nuff said. @@ -219,7 +218,7 @@ ADVENTURE
5/7 | Walk up |Matthew, PhilU, Steve
We walked from Top Camp to Scarface. It was a bastard. Got changed and sweated whilst waiting for everyone else. Entered cave and trundled along to @@ -239,8 +238,8 @@ Trips same day finding: Interview Blues &
6/7 | Pushing Leads off Trifurcation | Nick Anthony Brian
+(or Silly Bastards go caving in the rain) The caving was lovely, the walk in (55mins) and the walk out (45mins) were done in the pissing rain. Had we @@ -268,8 +267,8 @@ This can only be reached by a very airy traverse - a job for the drill.
5/7 Pushing 95-54 near MINOAN surprise. Placed back up bolt to left of +
5/7 | minoan surprise |Brian & Anthony
+ Pushing 95-54 near MINOAN surprise. Placed back up bolt to left of
pitch head. Found Stubai Al. crab - last years ? Placed another bolt at pitch
head, descended 10m placed rebelay bolt went down to next ledge 7m down
couldn't see bottom so tied off rope bag & exited cave
@@ -283,7 +282,9 @@ Trips same day finding: Puerile Humour &
6/7 Got down to 10m rebelay descended 7m placed +
6/7 | caver | unknown
+ + Got down to 10m rebelay descended 7m placed another rebelay just below ledge then 60m freehang with deviation off sharp flake on right about 35m down giving nice freehang descent to land on boulder slope at bottom to left is ascending rift up small streamway - not pushed - @@ -302,7 +303,8 @@ TU 5 ½ hrsunknown | Journey out | PhilB & Ralph
+Planning? Who needs it! I 'phoned Ralph on Wednesday to make arrangements i.e. to meet at Julian's house on Saturday afternoon; Midday Saturday, I @@ -324,7 +326,7 @@ more credit to the car for never faltering (thanks, Pete!)
9/7/96 | attempt to go caving | Nick, Brian, PhilU & Anthony
After two day's festering with 11 belching farting cavers in the potato hut, team keen decided to earn some super hero points by going caving in @@ -351,8 +353,7 @@ trip (I hope)]
5/7/96 | Journey out - not via Frankfurt | Dunks, paul & Jen
Quite a straightforward journey really, except for there seems to have been some sort of communication fuck-up concerning the route. @@ -374,7 +375,7 @@ have to remove the headlights. In turn, to get to the clips holding the headlight in place, you have to remove the radiator grille...
Things weren't helped by someone having done a bodge at some stage with -one of the retaining clips for the headlight making the *#£!!ng thing damn +one of the retaining clips for the headlight making the *#�!!ng thing damn near impossible to put back in place.
Eventually fettled it all. Checked everything was working and set off. @@ -383,8 +384,7 @@ that then...
11/7/96 | Surveying big pitch off Minoan Surprise (QM 95-54) | Brian, Nick and Anthony
Finally went caving after 4 days of inaction. First laid some string along the route through Triassic Park - v tedious. Someone else can do the rest. @@ -418,7 +418,7 @@ Those waiting at the bottom were most relieved to see the return of the rope.
12/7/96 | Journey out | Andrew, Andrew, Juliete + Dave
It was awful. Austria was too near so we thought we (A+D) would empty Andrew's house to Southampton to make it take longer. So, we bought a tow @@ -488,8 +488,7 @@ Staud'n'wirt and YOU'VE ALL SODDED OFF!
unknown | Journey Out - Trouble free motoring in the badvan | Julian Todd, Wookey
The bad van struck again. I negotiated a subsidy from NC Graphics UK Ltd. to carry a Pentium Pro to NC Graphics Deutschland near Munich instead of @@ -520,8 +519,7 @@ up the perch pass in 1st gear got us to an empty campsite.
11/7/96 | 161 - Pushing Puerile Humour | Ralph, Steve, Matthew
The finds extending N from nr. Ringpiece Junction, having fallen victim to a Gössered-up naming session by Steve, have become the Puerile Humour @@ -546,8 +544,7 @@ pushing got done - Raining outside.
14/7/96 | 161 - Puerile Humour | Lumatt + Ralph
Excellent stroll to this series. Pitch '(20m?)' descended 7m on 2 naturals across traverse (NATURALS CITY 1) 3m to top of NC2. On left at diff --git a/years/1997/log.htm b/years/1997/log.htm index 64306ec6f..e3b53d9d0 100644 --- a/years/1997/log.htm +++ b/years/1997/log.htm @@ -302,7 +302,6 @@ strong cold draft. circular entrance with mud floor, leads to a 3m deep pot which is blind. The way on over the top of the pot soon chokes - no draft. -
Dave
T/U 7 ¾ hours -
Previous trip / The surveying trip Next trip / -136 trip & +136 trip Siberia trip (same day)
Previous trip (Where The Wind Blows) / Next trip - 1999 ? @@ -922,7 +917,7 @@ Team up as we pigged out on tortellini again. A fine trip on a dreary day - KH over 500m + a new entrance!!!
Previous trip / -Next trips (into 161): Forbidden Land & +Forbidden Land & Gravel Pit / Next 136 push @@ -1038,7 +1033,7 @@ pitch with wind farting up it.
Previous trip / Next SEP trip / -Next Siberia trip (Fuzzy Logic) +Next Siberia trip
Next Moomintroll trip / -Other trips (same day): 136 Forbidden Land / +136 Forbidden Land / 136 Gravel Pit / Siberia