[svn] Reverted the reverts from 8267. Fixed the next / previous trip in personexpedition on the LogbookEntry template -- I had misunderstood what this was supposed to do last time I messed with it. This involved adding the methods PersonTrip.get_persons_next_trip and persons_previous_trip. Couldn't find any other broken things.

Kept the productive changes in 8267: extending the logbook parsing back to 1993, changing index page, changes to view_surveys.py

Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8274 by aaron @ 3/14/2009 8:38 AM
This commit is contained in:
substantialnoninfringinguser
2009-05-13 06:02:42 +01:00
parent 64000dda37
commit 91e4f0f8c0
7 changed files with 42 additions and 36 deletions

View File

@@ -260,7 +260,19 @@ class PersonTrip(TroggleModel):
def __unicode__(self):
return "%s %s (%s)" % (self.person_expedition, self.place, self.date)
def get_persons_next_trip(self):
try:
return PersonTrip.objects.filter(person_expedition__person=self.person_expedition.person, date__gt=self.date)[0]
except:
return
def get_persons_previous_trip(self):
try:
return PersonTrip.objects.filter(person_expedition__person=self.person_expedition.person, date__lt=self.date)[0]
except:
return
# def get_persons_previous_trip(self):
#
# move following classes into models_cave
#