[ADD]Odoo hydict macro
This commit is contained in:
parent
1a44194047
commit
34510b8c7a
@ -43,6 +43,18 @@
|
|||||||
value (nth hy-domain 3))
|
value (nth hy-domain 3))
|
||||||
`(, ~field ~op ~value))
|
`(, ~field ~op ~value))
|
||||||
|
|
||||||
|
(defmacro hydict [dic]
|
||||||
|
"Generate dict with mangled keys, from HyDict list"
|
||||||
|
(setv mangled-dic
|
||||||
|
(list
|
||||||
|
(map
|
||||||
|
(fn [pair]
|
||||||
|
(if (even? (nth pair 0))
|
||||||
|
(mangle (nth pair 1))
|
||||||
|
(nth pair 1)))
|
||||||
|
(enumerate dic))))
|
||||||
|
`{~@mangled-dic})
|
||||||
|
|
||||||
; XML helpers functions and macros
|
; XML helpers functions and macros
|
||||||
|
|
||||||
(defn odoo [&rest args] (xmlroot (xmln "odoo" {} #*args)))
|
(defn odoo [&rest args] (xmlroot (xmln "odoo" {} #*args)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user