2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 01:27:10 +00:00

[svn] Added new abstract base class TroggleModel. Any fields or methods that need to be added to multiple models should be added here.

Added edit links to caves, people, logbook entries, and people.
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8260 by aaron @ 2/26/2009 5:28 AM
This commit is contained in:
substantialnoninfringinguser
2009-05-13 05:56:56 +01:00
parent e9cc5094b9
commit 4b34241a16
9 changed files with 34 additions and 30 deletions

View File

@@ -252,7 +252,6 @@ def SetDatesFromLogbookEntries(expedition):
persontrips = personexpedition.persontrip_set.order_by('date')
personexpedition.date_from = min([persontrip.date for persontrip in persontrips] or [None])
personexpedition.date_to = max([persontrip.date for persontrip in persontrips] or [None])
personexpedition.dates_guessed = True
personexpedition.save()
# The below is all unnecessary, just use the built in get_previous_by_date and get_next_by_date
@@ -269,7 +268,6 @@ def SetDatesFromLogbookEntries(expedition):
# from trips rather than logbook entries, which may include events outside the expedition
expedition.date_from = min([personexpedition.date_from for personexpedition in expedition.personexpedition_set.all() if personexpedition.date_from] or [None])
expedition.date_to = max([personexpedition.date_to for personexpedition in expedition.personexpedition_set.all() if personexpedition.date_to] or [None])
expedition.dates_guessed = True
expedition.save()
# The below has been replaced with the methods get_next_by_id and get_previous_by_id