summaryrefslogtreecommitdiffstats
path: root/core/views_other.py
diff options
context:
space:
mode:
authorsubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-07-04 08:27:49 +0100
committersubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-07-04 08:27:49 +0100
commitb816463d1d81faeba373349c2728d435515a0a45 (patch)
tree7c051e8b06fe40b10f57d80e8bb76dbc4a8a3d64 /core/views_other.py
parent96533882c7c251dc039359b36dd2830c02976b1f (diff)
downloadtroggle-b816463d1d81faeba373349c2728d435515a0a45.tar.gz
troggle-b816463d1d81faeba373349c2728d435515a0a45.tar.bz2
troggle-b816463d1d81faeba373349c2728d435515a0a45.zip
[svn] * Adding JS fill in next QM number via ajax.
* Slight models cleanup- get rid of TroggleImageModel class, use mixin instead. * Collect various troggle shared functions into utils.py
Diffstat (limited to 'core/views_other.py')
-rw-r--r--core/views_other.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/core/views_other.py b/core/views_other.py
index 07a4a75..4a10a53 100644
--- a/core/views_other.py
+++ b/core/views_other.py
@@ -23,15 +23,9 @@ def stats(request):
return render_with_context(request,'statistics.html', statsDict)
def frontpage(request):
- message = "no test message" #reverse('personn', kwargs={"name":"hkjhjh"})
- if "reloadexpos" in request.GET:
- message = LoadPersonsExpos()
- message = "Reloaded personexpos"
- if "reloadsurvex" in request.POST:
- message = LoadAllSurvexBlocks()
- message = "Reloaded survexblocks"
+ if request.user.is_authenticated:
+ return render_with_context(request,'tasks.html')
- #'randSent':randSent.randomLogbookSentence(),
expeditions = Expedition.objects.order_by("-year")
logbookentry = LogbookEntry
cave = Cave
@@ -153,3 +147,13 @@ def ajax_test(request):
def eyecandy(request):
return render_with_context(request,'eyecandy.html', {})
+
+def ajax_QM_number(request):
+ if request.method=='POST':
+ cave=Cave.objects.get(id=request.POST['cave'])
+ print cave
+ exp=Expedition.objects.get(pk=request.POST['year'])
+ print exp
+ res=cave.new_QM_number(exp.year)
+
+ return HttpResponse(res) \ No newline at end of file