summaryrefslogtreecommitdiffstats
path: root/expo/views_caves.py
diff options
context:
space:
mode:
authorsubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-13 05:31:21 +0100
committersubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-13 05:31:21 +0100
commitf02c91901c517680a31d383e55977f8fe1ab3918 (patch)
tree5831d71c03c7edc26c97dd572fa0885b89143d7f /expo/views_caves.py
parent67f24d76ae9f251407cf4ee0185b6c9b2655b9e8 (diff)
downloadtroggle-f02c91901c517680a31d383e55977f8fe1ab3918.tar.gz
troggle-f02c91901c517680a31d383e55977f8fe1ab3918.tar.bz2
troggle-f02c91901c517680a31d383e55977f8fe1ab3918.zip
[svn] More work on survey images parser and virtual survey binder. Renamed expedition_year field of Survey model to expedition because this makes more sense.
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8163 by aaron @ 1/16/2009 7:50 PM
Diffstat (limited to 'expo/views_caves.py')
-rw-r--r--expo/views_caves.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/expo/views_caves.py b/expo/views_caves.py
index 8d0a4f4..045dbcf 100644
--- a/expo/views_caves.py
+++ b/expo/views_caves.py
@@ -1,5 +1,5 @@
from django.shortcuts import render_to_response
-from troggle.expo.models import Cave, CaveAndEntrance, Survey
+from troggle.expo.models import Cave, CaveAndEntrance, Survey, Expedition
import troggle.settings as settings
from troggle.expo.forms import CaveForm
import search
@@ -35,14 +35,22 @@ def caveSearch(request):
def surveyindex(request):
surveys=Survey.objects.all()
- return render_to_response('survey.html',{'settings':settings,'surveys':surveys})
+ expeditions=Expedition.objects.all()
+ dictToPass=locals()
+ dictToPass.update({'settings':settings})
+ return render_to_response('survey.html',dictToPass)
-def survey(request,survey_id):
+def survey(request,year,wallet_number):
surveys=Survey.objects.all()
- current_survey=Survey.objects.get(pk=survey_id)
- notes=current_survey.scannedimage_set.filter(contents='notes')
- planSketches=current_survey.scannedimage_set.filter(contents='plan')
- elevationSketches=current_survey.scannedimage_set.filter(contents='elevation')
+ expeditions=Expedition.objects.all()
+ current_expedition=Expedition.objects.filter(year=year)[0]
+
+ if wallet_number!='':
+ current_survey=Survey.objects.filter(expedition=current_expedition,wallet_number=wallet_number)[0]
+ notes=current_survey.scannedimage_set.filter(contents='notes')
+ planSketches=current_survey.scannedimage_set.filter(contents='plan')
+ elevationSketches=current_survey.scannedimage_set.filter(contents='elevation')
+
dictToPass=locals()
dictToPass.update({'settings':settings})