diff --git a/avisstage/documents.py b/avisstage/documents.py index 3995b3c..b2fcf50 100644 --- a/avisstage/documents.py +++ b/avisstage/documents.py @@ -46,27 +46,30 @@ class StageDocument(DocType): ] def prepare_thematiques(self, instance): - return ", ".join(instance.thematiques.all().values_list("name", flat=True)) + return ", ".join(instance.thematiques.all().values_list("name", flat=True)).lower() def prepare_matieres(self, instance): - return ", ".join(instance.matieres.all().values_list("nom", flat=True)) + return ", ".join(instance.matieres.all().values_list("nom", flat=True)).lower() def prepare_niveau_scol(self, instance): - return instance.get_niveau_scol_display() + return instance.get_niveau_scol_display().lower() def prepare_type_stage(self, instance): - return instance.type_stage_fancy + return instance.type_stage_fancy.lower() def prepare_date_fin(self, instance): return instance.date_fin.year def prepare_date_debut(self, instance): return instance.date_debut.year + + def prepare_sujet(self, instance): + return instance.sujet.lower() # Hook pour l'affichage des noms de pays def prepare(self, instance): data = super(StageDocument, self).prepare(instance) for lieu in data['lieux']: - lieu['pays'] = PAYS_DICT[lieu['pays']] + lieu['pays'] = PAYS_DICT[lieu['pays']].lower() return data