data issues much easier to read

This commit is contained in:
Philip Sargent 2021-04-12 01:00:47 +01:00
parent bc9b4f508b
commit f6f83c6f70
2 changed files with 24 additions and 13 deletions

View File

@ -145,11 +145,10 @@ def stats(request):
return render(request,'statistics.html', renderDict) return render(request,'statistics.html', renderDict)
def dataissues(request): def dataissues(request):
didict={} def myFunc(di):
for di in DataIssue.objects.all(): return di.parser.lower() + di.message.lower()
didict['parser'] = di.parser
didict['message']= di.message
didict['date']= di.date
alldi = DataIssue.objects.all
return render(request,'dataissues.html', {'didict': alldi}) dilist = list(DataIssue.objects.all())
dilist.sort(key = myFunc)
return render(request,'dataissues.html', {'didict': dilist})

View File

@ -7,16 +7,28 @@
<p> <p>
This is work in progress (April 2021). This is work in progress (April 2021).
<style>
tr { text-align:center;
font-family: Tahoma,'Trebuchet MS','Lucida Grande',Verdana, Arial, Helvetica, Sans-Serif;
font-size: 11pt;
line-height: 160%;
};
td { background : lightblue; }
</style>
<table> <table>
<tr><th>Parser</th><th>Issue</th><th>Import Date</th></tr> <tr><th>Parser</th><th>Issue</th></tr>
{% for di in didict %} {% for di in didict %}
<tr> {% ifchanged di.parser %}
<td style="text-align:center">{{di.parser}}</td> <tr {% cycle 'LightGoldenRodYellow' 'lightcyan' as mycolor %}>
<td style="text-align:left">{{di.message}}</td> {% else %}
<td style="text-align:center" width=25%>{{di.date}}</td> <tr>
</tr> {% endifchanged %}
<td bgcolor={{mycolor}}>{{di.parser}}</td>
<td bgcolor={{mycolor}} style="text-align:left">{{di.message}}</td>
</tr>
{% endfor %} {% endfor %}
</font>
</table> </table>