From 7677d77ad26f4f42f50f0e03fb795e718bd9b7b8 Mon Sep 17 00:00:00 2001
From: Pavel 'LEdoian' Turinsky <ledoian@matfyz.cz>
Date: Wed, 15 Apr 2020 23:41:01 +0200
Subject: [PATCH] =?UTF-8?q?Rozeps=C3=A1n=C3=AD,=20co=20se=20d=C4=9Bje=20v?=
 =?UTF-8?q?=20anotaci=20a=20dict=20comprehension?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 seminar/views/views_all.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py
index cf85096e..05c00cdb 100644
--- a/seminar/views/views_all.py
+++ b/seminar/views/views_all.py
@@ -439,7 +439,11 @@ def body_resitelu_odjakziva(rocnik, resitele):
 #				pricti_body(body_odjakziva, r, hodn.body)
 
 # Zkusíme agregovat:
+	# Následující řádek přidá ke každému řešiteli údaj ".body" se součtem jejich bodů
 	resitele_s_body = Resitel.objects.annotate(body=Sum('reseni__hodnoceni__body'))
+	# Teď jen z QuerySetu řešitelů anotovaných body vygenerujeme slovník indexovaný řešitelským id obsahující body
+	# ... ale jen ro řešitele, které dostaneme jako parametr.
+	# TODO: Zjistit, co ten parametr říká a proč je potřeba
 	body_odjakziva = {int(res.id) : res.body for res in resitele_s_body if res in resitele}
 	return body_odjakziva