summaryrefslogtreecommitdiffstats
path: root/core/views/statistics.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/statistics.py')
-rw-r--r--core/views/statistics.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/views/statistics.py b/core/views/statistics.py
index c22d1a4..34fe66c 100644
--- a/core/views/statistics.py
+++ b/core/views/statistics.py
@@ -125,10 +125,10 @@ def pathsreport(request):
def stats(request):
statsDict={}
- statsDict['expoCount'] = "{:,}".format(Expedition.objects.count())
- statsDict['caveCount'] = "{:,}".format(Cave.objects.count())
- statsDict['personCount'] = "{:,}".format(Person.objects.count())
- statsDict['logbookEntryCount'] = "{:,}".format(LogbookEntry.objects.count())
+ statsDict['expoCount'] = f"{Expedition.objects.count():,}"
+ statsDict['caveCount'] = f"{Cave.objects.count():,}"
+ statsDict['personCount'] = f"{Person.objects.count():,}"
+ statsDict['logbookEntryCount'] = f"{LogbookEntry.objects.count():,}"
legsbyexpo = [ ]
addupsurvexlength = 0
@@ -142,8 +142,8 @@ def stats(request):
legsyear += int(survexblock.legsall)
addupsurvexlength += survexleglength
addupsurvexlegs += legsyear
- legsbyexpo.append((expedition, {"nsurvexlegs": "{:,}".format(legsyear),
- "survexleglength":"{:,.0f}".format(survexleglength)}))
+ legsbyexpo.append((expedition, {"nsurvexlegs": f"{legsyear:,}",
+ "survexleglength":f"{survexleglength:,.0f}"}))
legsbyexpo.reverse()
renderDict = {**statsDict, **{ "addupsurvexlength":addupsurvexlength/1000, "legsbyexpo":legsbyexpo, "nsurvexlegs":addupsurvexlegs }} # new syntax