diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-07-04 08:27:49 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-07-04 08:27:49 +0100 |
commit | dd76a1a0be0345bf1a2330cefe299af92b9a5721 (patch) | |
tree | 8f0956a3763bbdbfaf29f88e5bc9d2463b30fc00 /core/views_other.py | |
parent | c132477f80342a5174719922889fc04056de482e (diff) | |
download | troggle-dd76a1a0be0345bf1a2330cefe299af92b9a5721.tar.gz troggle-dd76a1a0be0345bf1a2330cefe299af92b9a5721.tar.bz2 troggle-dd76a1a0be0345bf1a2330cefe299af92b9a5721.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.py | 20 |
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 |