From c6cce8d2fe470b42740258e737877d94d1b3fdb2 Mon Sep 17 00:00:00 2001 From: substantialnoninfringinguser Date: Wed, 13 May 2009 05:27:43 +0100 Subject: [svn] Add beginnings of virtual survey binder: new Survey and ScannedImage models, survey parser. Still has lots of problems, but I need some help with the file upload aspect so am committing now. Biggest problem is trying to call save() on the images from the API. It needs arguments that I don't understand. Also, the # in our survey paths was causing trouble. I worked around this with a correctURL method which urlencodes the actual URL, but admin still tries to use a URL with a # in it. Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8152 by aaron @ 1/15/2009 6:22 AM --- expo/views_caves.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'expo/views_caves.py') diff --git a/expo/views_caves.py b/expo/views_caves.py index 1f108f8..8d0a4f4 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 +from troggle.expo.models import Cave, CaveAndEntrance, Survey import troggle.settings as settings from troggle.expo.forms import CaveForm import search @@ -33,5 +33,17 @@ def caveSearch(request): { 'query_string': query_string, 'found_entries': found_entries, 'settings': settings}) #context_instance=RequestContext(request)) - - +def surveyindex(request): + surveys=Survey.objects.all() + return render_to_response('survey.html',{'settings':settings,'surveys':surveys}) + +def survey(request,survey_id): + 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') + dictToPass=locals() + dictToPass.update({'settings':settings}) + + return render_to_response('survey.html',dictToPass) \ No newline at end of file -- cgit v1.2.3