diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-11-24 15:44:58 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-11-24 15:44:58 +0100 |
| commit | b4b113796455b85389df1c826f6e7ec93e804001 (patch) | |
| tree | da3f143888cf883dd1f109962c84cf58a74e523f /models/fertilizer-product.rkt | |
| parent | 507844a30cbbdaf166a2fd56c9a6e4985c7d7c97 (diff) | |
Add French name to nutrient model.
Diffstat (limited to 'models/fertilizer-product.rkt')
| -rw-r--r-- | models/fertilizer-product.rkt | 9 |
1 files changed, 6 insertions, 3 deletions
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) |