forked from expo/troggle
Convert.format() to f-strings with flynt
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user