Valeurs possibles dans la description des champs
This commit is contained in:
+6
-13
@@ -972,21 +972,14 @@ def make_donut(
|
||||
|
||||
def make_column_picker(page: str):
|
||||
table_data = []
|
||||
table_columns = [
|
||||
{
|
||||
for col in schema.names():
|
||||
column_data_schema = DATA_SCHEMA[col]
|
||||
column_data = {
|
||||
"id": col,
|
||||
"name": DATA_SCHEMA[col]["title"],
|
||||
"description": DATA_SCHEMA[col]["description"],
|
||||
"name": column_data_schema["title"],
|
||||
"description": column_data_schema["description"],
|
||||
}
|
||||
for col in schema.names()
|
||||
]
|
||||
for column in table_columns:
|
||||
new_column = {
|
||||
"id": column["id"],
|
||||
"name": column["name"],
|
||||
"description": DATA_SCHEMA[column["id"]]["description"],
|
||||
}
|
||||
table_data.append(new_column)
|
||||
table_data.append(column_data)
|
||||
|
||||
table = (
|
||||
DataTable(
|
||||
|
||||
+10
-1
@@ -124,7 +124,16 @@ def get_data_schema() -> dict:
|
||||
raw = _load_schema_file(cache_path)
|
||||
if raw is None:
|
||||
raise RuntimeError("Aucun schéma disponible (ni distant ni cache).")
|
||||
return OrderedDict((c["name"], c) for c in raw["fields"])
|
||||
schema = OrderedDict((c["name"], c) for c in raw["fields"])
|
||||
for col in schema.keys():
|
||||
new_obj = schema[col]
|
||||
if "enum" in new_obj:
|
||||
enums = ", ".join(new_obj["enum"])
|
||||
new_obj["description"] = (
|
||||
f"{new_obj['description']} Valeurs possibles : {enums}"
|
||||
)
|
||||
print(schema["titulaire_typeIdentifiant"])
|
||||
return schema
|
||||
|
||||
|
||||
def prepare_dashboard_data(**filter_params) -> pl.DataFrame:
|
||||
|
||||
Reference in New Issue
Block a user