1
0
forked from ScoDoc/ScoDoc

fix sort args

This commit is contained in:
Emmanuel Viennet 2021-07-10 13:58:25 +02:00
parent dc726f1d10
commit 0afab38f6e
5 changed files with 5 additions and 5 deletions

View File

@ -458,7 +458,7 @@ def _fmt_etud_set(context, ins, max_list_size=7):
etuds = [] etuds = []
for etudid in ins: for etudid in ins:
etuds.append(sco_etud.get_etud_info(etudid=etudid, filled=True)[0]) etuds.append(sco_etud.get_etud_info(etudid=etudid, filled=True)[0])
etuds.sort(itemgetter("nom")) etuds.sort(key=itemgetter("nom"))
return ", ".join( return ", ".join(
[ [
'<a class="discretelink" href="ficheEtud?etudid=%(etudid)s">%(nomprenom)s</a>' '<a class="discretelink" href="ficheEtud?etudid=%(etudid)s">%(nomprenom)s</a>'

View File

@ -98,7 +98,7 @@ def _descr_decisions_ues(context, nt, etudid, decisions_ue, decision_sem):
uelist.append(nt.get_etud_ue_status(etudid, ue["ue_id"])["ue"]) uelist.append(nt.get_etud_ue_status(etudid, ue["ue_id"])["ue"])
except KeyError: except KeyError:
pass pass
uelist.sort(itemgetter("numero")) uelist.sort(key=itemgetter("numero"))
return uelist return uelist

View File

@ -911,7 +911,7 @@ def _descr_etud_set(context, etudids):
for etudid in etudids: for etudid in etudids:
etuds.append(sco_etud.get_etud_info(etudid=etudid, filled=True)[0]) etuds.append(sco_etud.get_etud_info(etudid=etudid, filled=True)[0])
# sort by name # sort by name
etuds.sort(itemgetter("nom")) etuds.sort(key=itemgetter("nom"))
return ", ".join([e["nomprenom"] for e in etuds]) return ", ".join([e["nomprenom"] for e in etuds])

View File

@ -424,7 +424,7 @@ def list_synch(context, sem, anneeapogee=None):
return etud return etud
etuds = [key2etud(x, etud_apo) for x in etudset] etuds = [key2etud(x, etud_apo) for x in etudset]
etuds.sort(itemgetter("nom")) etuds.sort(key=itemgetter("nom"))
return etuds return etuds
# #

View File

@ -1208,7 +1208,7 @@ def formsemestre_enseignants_list(context, REQUEST, formsemestre_id, format="htm
sem_ens[ens]["_email_target"] = "mailto:%s" % sem_ens[ens]["email"] sem_ens[ens]["_email_target"] = "mailto:%s" % sem_ens[ens]["email"]
sem_ens_list = list(sem_ens.values()) sem_ens_list = list(sem_ens.values())
sem_ens_list.sort(itemgetter("nomprenom")) sem_ens_list.sort(key=itemgetter("nomprenom"))
# --- Generate page with table # --- Generate page with table
title = "Enseignants de " + sem["titremois"] title = "Enseignants de " + sem["titremois"]