Working through getting record creation going

This commit is contained in:
Simon Brooke 2018-08-05 14:52:26 +01:00
parent 8fbe32c5c2
commit 8fbeaa55e3

View file

@ -474,9 +474,9 @@
"Return `true` it the value of this `property` may be set from user-supplied data."
[property]
(and
(= (:tag property) :property)
(not (#{"link"} (:type (:attrs property))))
(not (system-generated? property))))
(= (:tag property) :property)
(not (#{"link" "list"} (:type (:attrs property))))
(not (system-generated? property))))
(defmacro all-properties
@ -509,6 +509,17 @@
(all-properties ~entity)))
(defn required-properties
"Return the properties of this `entity` which are required and are not
system generated."
[entity]
(filter
#(and
(= (:required (:attrs %)) "true")
(not (system-generated? %)))
(descendants-with-tag entity :property)))
(defmacro key-properties
[entity]
`(children-with-tag (first (children-with-tag ~entity :key)) :property))