From b4b113796455b85389df1c826f6e7ec93e804001 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Mon, 24 Nov 2025 15:44:58 +0100 Subject: Add French name to nutrient model. --- models/fertilizer-product.rkt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'models/fertilizer-product.rkt') diff --git a/models/fertilizer-product.rkt b/models/fertilizer-product.rkt index 347d141..b0ac7de 100644 --- a/models/fertilizer-product.rkt +++ b/models/fertilizer-product.rkt @@ -39,7 +39,7 @@ (for ([(n v) (in-hash (fertilizer-product-nutrient-values v))]) (fprintf out "~a ~a\n" - (~a (nutrient-name n) #:min-width 14) + (~a (nutrient-canonical-name n) #:min-width 14) (~a v #:max-width 6 #:align 'right))))) ;; CREATE @@ -91,6 +91,7 @@ fp.brand_name n.id n.canonical_name + n.french_name n.formula nv.value_ppm #:from (TableExpr:AST ,joined) @@ -115,6 +116,7 @@ fp.brand_name n.id n.canonical_name + n.french_name n.formula nv.value_ppm #:from (TableExpr:AST ,joined) @@ -128,15 +130,16 @@ [many (error 'get-fertilizer-product "expected 1 fertilizer product, got ~a" (length many))])) (define (get-fertilizer-product-values fertilizer-product) - (for/hash ([(nutrient-id name formula value_ppm) + (for/hash ([(nutrient-id canonical-name french-name formula value_ppm) (in-query (current-conn) (select n.id n.canonical_name + n.french_name n.formula nv.value_ppm #:from (TableExpr:AST ,joined) #:where (= fp.id ,(fertilizer-product-id fertilizer-product))))]) - (values (nutrient nutrient-id name formula) value_ppm))) + (values (nutrient nutrient-id canonical-name french-name formula) value_ppm))) (define (get-fertilizer-product-value fertilizer-product nutrient) (query-maybe-value (current-conn) -- cgit v1.2.3