2009-05-13 05:22:14 +01:00
|
|
|
from django.shortcuts import render_to_response
|
|
|
|
from troggle.expo.models import Cave, Expedition, Person, LogbookEntry
|
|
|
|
import troggle.settings as settings
|
|
|
|
from django import forms
|
|
|
|
from django.db.models import Q
|
2009-05-13 05:25:17 +01:00
|
|
|
import re
|
|
|
|
import randSent
|
2009-05-13 05:22:14 +01:00
|
|
|
|
|
|
|
def stats(request):
|
|
|
|
statsDict={}
|
|
|
|
statsDict['expoCount'] = int(Expedition.objects.count())
|
|
|
|
statsDict['caveCount'] = int(Cave.objects.count())
|
|
|
|
statsDict['personCount'] = int(Person.objects.count())
|
|
|
|
statsDict['logbookEntryCount'] = int(LogbookEntry.objects.count())
|
2009-05-13 05:25:17 +01:00
|
|
|
return render_to_response('statistics.html', statsDict)
|
|
|
|
|
|
|
|
def frontPage(request):
|
|
|
|
|
|
|
|
return render_to_response('index.html', {'randSent':randSent.randomLogbookSentence(),'settings':settings})
|