Indexation lowercase

This commit is contained in:
Evarin 2018-12-26 21:34:48 +01:00
parent 4dc201e572
commit a3f12a22f8

View file

@ -46,27 +46,30 @@ class StageDocument(DocType):
] ]
def prepare_thematiques(self, instance): 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): 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): 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): def prepare_type_stage(self, instance):
return instance.type_stage_fancy return instance.type_stage_fancy.lower()
def prepare_date_fin(self, instance): def prepare_date_fin(self, instance):
return instance.date_fin.year return instance.date_fin.year
def prepare_date_debut(self, instance): def prepare_date_debut(self, instance):
return instance.date_debut.year return instance.date_debut.year
def prepare_sujet(self, instance):
return instance.sujet.lower()
# Hook pour l'affichage des noms de pays # Hook pour l'affichage des noms de pays
def prepare(self, instance): def prepare(self, instance):
data = super(StageDocument, self).prepare(instance) data = super(StageDocument, self).prepare(instance)
for lieu in data['lieux']: for lieu in data['lieux']:
lieu['pays'] = PAYS_DICT[lieu['pays']] lieu['pays'] = PAYS_DICT[lieu['pays']].lower()
return data return data