Commit
·
d95827b
1
Parent(s):
645ae7a
V3 04
Browse files- ActionsRSE.py +8 -6
ActionsRSE.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import data_manager
|
| 3 |
|
|
@@ -6,9 +7,9 @@ def display_actions_rse():
|
|
| 6 |
data, total_hits = data_manager.get_data()
|
| 7 |
|
| 8 |
if total_hits > 0:
|
| 9 |
-
#
|
| 10 |
-
noms_entreprises = sorted({record.get("
|
| 11 |
-
secteurs = sorted({record.get("
|
| 12 |
|
| 13 |
# Interface utilisateur pour les filtres
|
| 14 |
entreprises_selectionnees = st.multiselect("Filtre par nom d'entreprise :", noms_entreprises)
|
|
@@ -17,14 +18,15 @@ def display_actions_rse():
|
|
| 17 |
# Filtrage des actions RSE
|
| 18 |
actions_filtrees = [
|
| 19 |
record for record in data
|
| 20 |
-
if (record.get("
|
| 21 |
-
and (record.get("
|
| 22 |
]
|
| 23 |
|
| 24 |
# Affichage des actions RSE filtrées
|
| 25 |
if actions_filtrees:
|
| 26 |
for action in actions_filtrees:
|
| 27 |
-
|
|
|
|
| 28 |
else:
|
| 29 |
st.write("Aucune action RSE correspondante trouvée.")
|
| 30 |
else:
|
|
|
|
| 1 |
+
|
| 2 |
import streamlit as st
|
| 3 |
import data_manager
|
| 4 |
|
|
|
|
| 7 |
data, total_hits = data_manager.get_data()
|
| 8 |
|
| 9 |
if total_hits > 0:
|
| 10 |
+
# Correction des clés pour correspondre à celles des données
|
| 11 |
+
noms_entreprises = sorted({record.get("nom_entreprise") for record in data if record.get("nom_entreprise")})
|
| 12 |
+
secteurs = sorted({record.get("libelle_section_naf") for record in data if record.get("libelle_section_naf")})
|
| 13 |
|
| 14 |
# Interface utilisateur pour les filtres
|
| 15 |
entreprises_selectionnees = st.multiselect("Filtre par nom d'entreprise :", noms_entreprises)
|
|
|
|
| 18 |
# Filtrage des actions RSE
|
| 19 |
actions_filtrees = [
|
| 20 |
record for record in data
|
| 21 |
+
if (record.get("nom_entreprise") in entreprises_selectionnees or not entreprises_selectionnees)
|
| 22 |
+
and (record.get("libelle_section_naf") in secteurs_selectionnes or not secteurs_selectionnes)
|
| 23 |
]
|
| 24 |
|
| 25 |
# Affichage des actions RSE filtrées
|
| 26 |
if actions_filtrees:
|
| 27 |
for action in actions_filtrees:
|
| 28 |
+
# Assurez-vous que les clés utilisées ici sont correctes
|
| 29 |
+
st.write(f"Entreprise: {action.get('nom_entreprise')}, Action: {action.get('action_rse')}")
|
| 30 |
else:
|
| 31 |
st.write("Aucune action RSE correspondante trouvée.")
|
| 32 |
else:
|