Formatage des montants #45
This commit is contained in:
@@ -6,6 +6,7 @@ from dash import Input, Output, State, callback, dash_table, dcc, html, register
|
||||
from src.figures import point_on_map
|
||||
from src.utils import (
|
||||
add_org_links_in_dict,
|
||||
format_montant,
|
||||
format_number,
|
||||
get_annuaire_data,
|
||||
get_departement_region,
|
||||
@@ -180,6 +181,7 @@ def get_acheteur_marches_data(url, acheteur_year: str) -> pl.LazyFrame:
|
||||
"objet",
|
||||
"dateNotification",
|
||||
"titulaire_id",
|
||||
"titulaire_typeIdentifiant",
|
||||
"titulaire_nom",
|
||||
"montant",
|
||||
"codeCPV",
|
||||
@@ -210,6 +212,9 @@ def get_last_marches_table(data) -> html.Div:
|
||||
"dureeMois",
|
||||
]
|
||||
|
||||
dff = pl.DataFrame(data)
|
||||
dff = format_montant(dff)
|
||||
data = dff.to_dicts()
|
||||
data = add_org_links_in_dict(data, "titulaire")
|
||||
|
||||
table = html.Div(
|
||||
@@ -231,7 +236,7 @@ def get_last_marches_table(data) -> html.Div:
|
||||
"hideable": False,
|
||||
}
|
||||
for i in columns
|
||||
if i not in ["titulaire_id"]
|
||||
if i not in ["titulaire_id", "titulaire_typeIdentifiant"]
|
||||
],
|
||||
page_size=10,
|
||||
style_cell_conditional=[
|
||||
|
||||
@@ -8,6 +8,7 @@ from src.utils import (
|
||||
add_org_links,
|
||||
add_resource_link,
|
||||
filter_table_data,
|
||||
format_montant,
|
||||
format_number,
|
||||
lf,
|
||||
meta_content,
|
||||
@@ -184,6 +185,9 @@ def update_table(page_current, page_size, filter_query, sort_by, data_timestamp)
|
||||
# Ajout des liens vers les fichiers Open Data
|
||||
dff = add_resource_link(dff)
|
||||
|
||||
# Formatage des montants
|
||||
dff = format_montant(dff)
|
||||
|
||||
# Liste finale de colonnes
|
||||
columns = [
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ from dash import Input, Output, State, callback, dash_table, dcc, html, register
|
||||
from src.figures import point_on_map
|
||||
from src.utils import (
|
||||
add_org_links_in_dict,
|
||||
format_montant,
|
||||
format_number,
|
||||
get_annuaire_data,
|
||||
get_departement_region,
|
||||
@@ -213,7 +214,11 @@ def get_last_marches_table(data) -> html.Div:
|
||||
"dureeMois",
|
||||
]
|
||||
|
||||
# Ajout des liens vers les acheteurs
|
||||
dff = pl.DataFrame(data)
|
||||
dff = format_montant(dff)
|
||||
data = dff.to_dicts()
|
||||
# Idéalement on utiliserait add_org_links(), mais le résultat attendu
|
||||
# est différent de home.py (Tableau)
|
||||
data = add_org_links_in_dict(data, "acheteur")
|
||||
|
||||
table = html.Div(
|
||||
|
||||
Reference in New Issue
Block a user