diff --git a/core/models_millenial.py b/core/models_millenial.py index c97be36..1534961 100644 --- a/core/models_millenial.py +++ b/core/models_millenial.py @@ -70,8 +70,8 @@ class ExpeditionM(models.Model): #instance of this class corresponds to one expo class SurveyM(models.Model): #instance of this class corresponds to one .svx file - one trip date = models.CharField(max_length=100) #date of the trip in format YYYY.MM.DD (dated:=date given by .svx file) - maxdepth = models.FloatField() #represents max depth of a node in this survey - + survex_file = models.TextField() + class Logbook_entryM(models.Model): #instance of this class corresponds to one bit of logbook (c.f. expo.survex.com/years/2015/logbook.html or simil) date = models.CharField(max_length=100) #date as typed into logbook contents = models.TextField() #contents of the logbook chunk diff --git a/core/views_caves.py b/core/views_caves.py index 302003d..170ef17 100644 --- a/core/views_caves.py +++ b/core/views_caves.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from troggle.core.models import CaveSlug, Cave, CaveAndEntrance, Survey, Expedition, QM, CaveDescription, EntranceSlug, Entrance, Area, SurvexStation, CaveM, Cave_descriptionM +from troggle.core.models import CaveSlug, Cave, CaveAndEntrance, Survey, Expedition, QM, CaveDescription, EntranceSlug, Entrance, Area, SurvexStation from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm import troggle.core.models as models import troggle.settings as settings @@ -21,6 +21,13 @@ import settings from PIL import Image, ImageDraw, ImageFont import string, os, sys, subprocess +# +# NEW CONTENT +# + + +from troggle.core.models import CaveM, Cave_descriptionM, ExpeditionM + def millenialcaves(request): #RW messing around area caves = CaveM.objects.all() @@ -31,6 +38,16 @@ def millenialdescription(request, slug): desc = Cave_descriptionM.objects.get(slug=slug) return render_with_context(request,'cave_uground_description.html', {'cave': desc}) +def millenialpeople(request): + expos = ExpeditionM.objects.all() + return render_with_context(request,'peoplemillenial.html' , {'expos': expos}) + + +# +# END NEW CONTENT +# + + def getCave(cave_id): """Returns a cave object when given a cave name or number. It is used by views including cavehref, ent, and qm.""" diff --git a/databaseResetM.py b/databaseResetM.py index 4530763..b70a4e7 100644 --- a/databaseResetM.py +++ b/databaseResetM.py @@ -50,10 +50,19 @@ def load_redirects(): f = troggle.flatpages.models.Redirect(originalURL = oldURL, newURL = newURL) f.save() +def load_surveys(): + SurveyM.objects.all().delete() + import troggle.parsers.surveysM + troggle.parsers.surveysM.load() + def load_caves(): import troggle.parsers.cavesM troggle.parsers.cavesM.load() +def load_people(): + import troggle.parsers.peopleM + troggle.parsers.peopleM.load() + def load_all(): load_caves() load_surveys() diff --git a/parsers/cavesM.py b/parsers/cavesM.py index 71bda0d..f9900d6 100644 --- a/parsers/cavesM.py +++ b/parsers/cavesM.py @@ -21,6 +21,9 @@ def load(): print('Loading caves of 1623 area') loadarea('1623') + print('Loading caves of 1626 area') + loadarea('1626') + def loadarea(areacode): diff --git a/urls.py b/urls.py index a38b7a4..4197712 100644 --- a/urls.py +++ b/urls.py @@ -24,6 +24,7 @@ actualurlpatterns = patterns('', url(r'^millenialcaves/?$', views_caves.millenialcaves, name="millenialcaves"), + url(r'^millenialpeople/?$', views_caves.millenialpeople, name="millenialpeople"), url(r'^cave/descriptionM/([^/]+)/?$', views_caves.millenialdescription), #url(r'^cave/description/([^/]+)/?$', views_caves.caveDescription),