Cleanup stat blocks

This commit is contained in:
AndyGrant committed 2018-06-10 03:09:57 -04:00
1 parent 7abc4ab567
commit f8e344fe00
4 files changed
+39 -24

No files matched your search

+17
View File
@@ -42,8 +42,25 @@ def gitDiffLink(test):
return "{0}/compare/{1}...{2}".format(repo, basesha[:8], devsha[:8])
def statParagraph(test):
tokens = test.devoptions.split(" ")
threads = tokens[0].split("=")[1]
hash = tokens[1].split("=")[1]
lowerllr = twoDigitPrecision(test.lowerllr)
currentllr = twoDigitPrecision(test.currentllr)
upperllr = twoDigitPrecision(test.upperllr)
elolower = twoDigitPrecision(test.elolower)
eloupper = twoDigitPrecision(test.eloupper)
return "SPRT @ {0}s Threads={1} Hash={2}MB<br>".format(test.timecontrol, threads, hash) \
+ "LLR: {0} ({1}, {2}) [{3}, {4}]<br>".format(lowerllr, currentllr, upperllr, elolower, eloupper) \
+ "Games: {0} W: {1} L: {2} D: {3}".format(test.games, test.wins, test.losses, test.draws)
register = template.Library()
register.filter("oneDigitPrecision", oneDigitPrecision)
register.filter("twoDigitPrecision", twoDigitPrecision)
register.filter("gitDiffLink", gitDiffLink)
register.filter("statParagraph", statParagraph)
+11 -1
View File
@@ -163,7 +163,17 @@ def editTest(request, id):
pass
def viewTest(request, id):
pass
try:
# Find Test and Results
test = Test.objects.get(id=id)
results = Results.objects.all().filter(test=test)
data = {'test' : test, 'results' : results}
return render(request, 'viewTest.html', data)
# Unable to find test
except Exception as error:
return index(request, error=str(error))
@staff_member_required
def approveTest(request, id):