diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-07-03 05:31:49 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-07-03 05:31:49 +0100 |
commit | 83fa1ea9ac9087bb895e5e85586e040522723b3e (patch) | |
tree | c628965e59a5b7074bf8246dc66e1e8df9faa507 /core/views_other.py | |
parent | 88aec344c4b4854a0af6fcabf6a8a354b9eb2f28 (diff) | |
download | troggle-83fa1ea9ac9087bb895e5e85586e040522723b3e.tar.gz troggle-83fa1ea9ac9087bb895e5e85586e040522723b3e.tar.bz2 troggle-83fa1ea9ac9087bb895e5e85586e040522723b3e.zip |
[svn] Brief code cleanup.
Diffstat (limited to 'core/views_other.py')
-rw-r--r-- | core/views_other.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/views_other.py b/core/views_other.py index b3da852..07a4a75 100644 --- a/core/views_other.py +++ b/core/views_other.py @@ -8,7 +8,7 @@ import re import randSent
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
-from troggle.alwaysUseRequestContext import render_response # see views_logbooks for explanation on this.
+from utils import render_with_context
from core.models import *
def showrequest(request):
@@ -20,7 +20,7 @@ def stats(request): statsDict['caveCount'] = int(Cave.objects.count())
statsDict['personCount'] = int(Person.objects.count())
statsDict['logbookEntryCount'] = int(LogbookEntry.objects.count())
- return render_response(request,'statistics.html', statsDict)
+ return render_with_context(request,'statistics.html', statsDict)
def frontpage(request):
message = "no test message" #reverse('personn', kwargs={"name":"hkjhjh"})
@@ -37,7 +37,7 @@ def frontpage(request): cave = Cave
photo = Photo
from django.contrib.admin.templatetags import log
- return render_response(request,'frontpage.html', locals())
+ return render_with_context(request,'frontpage.html', locals())
def todo(request):
message = "no test message" #reverse('personn', kwargs={"name":"hkjhjh"})
@@ -51,7 +51,7 @@ def todo(request): #'randSent':randSent.randomLogbookSentence(),
expeditions = Expedition.objects.order_by("-year")
totallogbookentries = LogbookEntry.objects.count()
- return render_response(request,'index.html', {'expeditions':expeditions, 'all':'all', 'totallogbookentries':totallogbookentries, "message":message})
+ return render_with_context(request,'index.html', {'expeditions':expeditions, 'all':'all', 'totallogbookentries':totallogbookentries, "message":message})
def calendar(request,year):
week=['S','S','M','T','W','T','F']
@@ -59,7 +59,7 @@ def calendar(request,year): expedition=Expedition.objects.get(year=year)
PersonExpeditions=expedition.personexpedition_set.all()
- return render_response(request,'calendar.html', locals())
+ return render_with_context(request,'calendar.html', locals())
def controlPanel(request):
jobs_completed=[]
@@ -77,11 +77,11 @@ def controlPanel(request): jobs_completed.append(item)
else:
if request.user.is_authenticated(): #The user is logged in, but is not a superuser.
- return render_response(request,'controlPanel.html', {'caves':Cave.objects.all(),'error':'You must be a superuser to use that feature.'})
+ return render_with_context(request,'controlPanel.html', {'caves':Cave.objects.all(),'error':'You must be a superuser to use that feature.'})
else:
return HttpResponseRedirect(reverse('auth_login'))
- return render_response(request,'controlPanel.html', {'caves':Cave.objects.all(),'expeditions':Expedition.objects.all(),'jobs_completed':jobs_completed})
+ return render_with_context(request,'controlPanel.html', {'caves':Cave.objects.all(),'expeditions':Expedition.objects.all(),'jobs_completed':jobs_completed})
def downloadCavetab(request):
from export import tocavetab
@@ -152,4 +152,4 @@ def ajax_test(request): mimetype="application/json")
def eyecandy(request):
- return render_response(request,'eyecandy.html', {})
+ return render_with_context(request,'eyecandy.html', {})
|