[svn r8221] merge the trip table to have surveys by date

This commit is contained in:
julian
2009-01-24 15:01:59 +01:00
parent e0d941fa54
commit 7d9ec8009a
9 changed files with 201 additions and 102 deletions

View File

@@ -262,3 +262,21 @@ for line in caveReader :
newCaveAndEntrance = models.CaveAndEntrance(cave = newCave, entrance = newEntrance, entrance_letter = entrance_letter)
newCaveAndEntrance.save()
# lookup function modelled on GetPersonExpeditionNameLookup
Gcavelookup = None
def GetCaveLookup():
global Gcavelookup
if Gcavelookup:
return Gcavelookup
Gcavelookup = {"NONEPLACEHOLDER":None}
for cave in models.Cave.objects.all():
Gcavelookup[cave.official_name.lower()] = cave
if cave.kataster_number:
Gcavelookup[cave.kataster_number] = cave
if cave.unofficial_number:
Gcavelookup[cave.unofficial_number] = cave
return Gcavelookup