forked from ScoDoc/ScoDoc
Option nom des colonnes pour publipostage
This commit is contained in:
parent
2459356245
commit
5fc1800f70
@ -56,6 +56,10 @@ class ParametrageClasseurPE(FlaskForm):
|
||||
# synthese_individuelle_etud = BooleanField(
|
||||
# "Générer (suppose les RCUES)"
|
||||
# )
|
||||
|
||||
publipostage = BooleanField(
|
||||
"Nomme les moyennes pour publipostage",
|
||||
# default=False,
|
||||
# render_kw={"checked": ""},
|
||||
)
|
||||
submit = SubmitField("Générer les classeurs poursuites d'études")
|
||||
cancel = SubmitField("Annuler", render_kw={"formnovalidate": True})
|
||||
|
@ -560,6 +560,10 @@ class JuryPE(object):
|
||||
for onglet, df in self.synthese.items():
|
||||
# Conversion colonnes en multiindex
|
||||
df_final = df.copy()
|
||||
if (
|
||||
"publipostage" not in self.options
|
||||
or not self.options["publipostage"]
|
||||
):
|
||||
df_final = convert_colonnes_to_multiindex(df_final)
|
||||
# Nom de l'onglet
|
||||
if isinstance(onglet, tuple):
|
||||
@ -824,6 +828,7 @@ def get_formsemestres_etudiants(etudiants: pe_etudiant.EtudiantsJuryPE) -> dict:
|
||||
def convert_colonnes_to_multiindex(df):
|
||||
"""Convertit les colonnes d'un df pour obtenir des colonnes
|
||||
multiindex"""
|
||||
df_final = df.copy()
|
||||
colonnes = list(df.columns)
|
||||
colonnes = [tuple(col.split("|")) for col in colonnes]
|
||||
# modifie le nom du semestre par sa descr
|
||||
@ -838,5 +843,5 @@ def convert_colonnes_to_multiindex(df):
|
||||
col_verbose = col
|
||||
colonnes_verbose.append(col_verbose)
|
||||
|
||||
df.columns = pd.MultiIndex.from_tuples(colonnes_verbose)
|
||||
return df
|
||||
df_final.columns = pd.MultiIndex.from_tuples(colonnes_verbose)
|
||||
return df_final
|
||||
|
Loading…
Reference in New Issue
Block a user