From f6f83c6f704ff66f6de7d3f51c83f3960ed0011b Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 12 Apr 2021 01:00:47 +0100 Subject: [PATCH] data issues much easier to read --- core/views/statistics.py | 13 ++++++------- templates/dataissues.html | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/core/views/statistics.py b/core/views/statistics.py index 574afa8..f7a5453 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -145,11 +145,10 @@ def stats(request): return render(request,'statistics.html', renderDict) def dataissues(request): - didict={} - for di in DataIssue.objects.all(): - didict['parser'] = di.parser - didict['message']= di.message - didict['date']= di.date - alldi = DataIssue.objects.all + def myFunc(di): + return di.parser.lower() + di.message.lower() + + dilist = list(DataIssue.objects.all()) + dilist.sort(key = myFunc) - return render(request,'dataissues.html', {'didict': alldi}) + return render(request,'dataissues.html', {'didict': dilist}) diff --git a/templates/dataissues.html b/templates/dataissues.html index f3b9543..7c518a0 100644 --- a/templates/dataissues.html +++ b/templates/dataissues.html @@ -7,16 +7,28 @@

This is work in progress (April 2021). + - + {% for di in didict %} - - - - - + {% ifchanged di.parser %} + + {% else %} + + {% endifchanged %} + + + {% endfor %} +
ParserIssueImport Date
ParserIssue
{{di.parser}}{{di.message}}{{di.date}}
{{di.parser}}{{di.message}}