   "Returns the corresponding attr-ident entry from `datomic-schema-index-reaction`."
   (memoize
     (fn [conn attr-ident]
-      (posh/pull conn '[*] [:db/ident attr-ident]))))
+      (posh/pull conn
+                 '[* {:db/valueType [:db/ident]} {:db/cardinality [:db/ident]}]
+                 [:db/ident attr-ident]))))
+
+;; Another function gives us a version of this that maps properly to idents
+(def attribute-signature-reaction
+  "Reaction of the pull of a schema attribute, where any references to something with an ident
+  have been replaced by that ident keyword."
+  (memoize
+    (fn [conn attr-ident]
+      (let [schema-rx (attribute-schema-reaction conn attr-ident)]
+        (reaction
+          (into {}
+            (map (fn [[k v]] [k (if-let [ident (:db/ident v)] ident v)])
+                 @schema-rx)))))))
+
 
 ;; This code below may get better performance once we get the new posh stuff working...
 ;; It would be nice though if we had some benchmarking stuff set up to be rigorous.

;; All rendering modes should be controllable via registered toggles or fn assignments
;; registration modules for plugins
;; * middleware?
;; * 


;(def DataScriptDB


(defn attr-values-view
  [conn pull-expr attr-ident values]
  [:div @(attributes-for-component conn pull-expr :attr-values-view)
   (for [value (utils/deref-or-value values)]
     ^{:id (hash value)}
     [value-view conn pull-expr attr-ident value])])


(defn cardinality
  [conn attr-ident])

;; Need to have controls etc here
(defn attr-view
  [conn pull-expr attr-ident values]
  [:div @(attributes-for-component conn pull-expr :attr-view)
   [label-view conn pull-expr attr-ident]
   (match [@(attribute-signature-reaction conn attr-ident)]
     [{:db/cardinality :db.cardinality/many}]
     [attr-values-view conn pull-expr attr-ident values]
     :else
     [value-view conn pull-expr attr-ident values])])


;(defn attribute-values-view
