From 72be0aebdbe6837337c862cb78696935f312da1e Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 6 Oct 2016 21:04:19 +0200 Subject: [PATCH] Sorted mate table --- templates/about.html | 20 ++++++++++++++++++++ tipp/views.py | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 templates/about.html diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000..7511608 --- /dev/null +++ b/templates/about.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} +{% load i18n static %} +{% load humanize %} +{% block head %} + +{% endblock %} + +{% block nav %} +{% include "nav.html" with ls=ls season=season %} +{% endblock %} + +{% block body %} +
+
+
+

Über TipPy

+ +
+
+
diff --git a/tipp/views.py b/tipp/views.py index 6c2e048..efe5d7a 100644 --- a/tipp/views.py +++ b/tipp/views.py @@ -430,6 +430,11 @@ def matchday(request, ls, season, matchday, template_name='md.html'): mate['tipps'].append(u'\u2714') except Exception as e: mate['tipps'].append(u'\u2717') + + """ sort items in mandant_dict by score """ + mandant_dict[mandant] = sorted(mandant_dict[mandant], + key=lambda k: k['sum_score'], reverse=True) + matches.append(item)