2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 14:17:08 +00:00

[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
This commit is contained in:
substantialnoninfringinguser
2009-07-04 08:27:49 +01:00
parent c132477f80
commit dd76a1a0be
9 changed files with 154 additions and 112 deletions

View File

@@ -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)