From 4da21bf4d358a1d7bca128e2a9f1db5c4af6484c Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 9 Oct 2022 14:25:49 +0200 Subject: [PATCH] tri des billets --- app/scodoc/sco_abs_billets.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_abs_billets.py b/app/scodoc/sco_abs_billets.py index eaafab89..d281b312 100644 --- a/app/scodoc/sco_abs_billets.py +++ b/app/scodoc/sco_abs_billets.py @@ -78,6 +78,15 @@ def table_billets( for billet in billets: billet_dict = billet.to_dict() rows.append(billet_dict) + billet_dict["_nomprenom_order"] = ( + billet.etudiant.sort_key if billet.etudiant else "" + ) + billet_dict["_abs_begin_str_order"] = ( + billet.abs_begin.isoformat() if billet.abs_begin else "" + ) + billet_dict["_abs_begin_str_order"] = ( + billet.abs_begin.isoformat() if billet.abs_end else "" + ) if billet_dict["abs_begin"].hour < 12: m = " matin" else: @@ -116,7 +125,7 @@ def table_billets( billet_dict["nomprenom"] = "???" # should not occur else: billet_dict["nomprenom"] = billet.etudiant.nomprenom - billet_dict["_nomprenom_disp_order"] = billet.etudiant.sort_key + billet_dict["_nomprenom_order"] = billet.etudiant.sort_key billet_dict[ "_nomprenom_td_attrs" ] = f'id="{billet.etudiant.id}" class="etudinfo"'