 
 (defmethod dt->hiccup [:text :create] [col ent-name _]
   (let [field-name (name (first col))]
-    (wrap-with-vec-and-label' col [:textarea.form-control (add-required-attr {:id   field-name
-                                                                              :name field-name}
-                                                                             ent-name col)
+    (wrap-with-vec-and-label' col [:textarea.form-control (-> {:id   field-name
+                                                               :name field-name}
+                                                              (add-required-attr col)
+                                                              (add-value ent-name col))
                                    (str "{{" ent-name "." field-name "}}")])))
 
 (defmethod dt->hiccup :default [col ent-name _]

  (let [field-name (name (first col))]
    (wrap-with-vec-and-label' col
                              [:input.form-control
                               (add-required-attr {:id   field-name
                                                   :name field-name}
                                                  ent-name col)])))

(defmethod dt->hiccup [:varchar :create] [col ent-name _]
  {:pre [(second (second col))]}
  (wrap-with-vec-and-label'
    col
    [:input.form-control (add-required-attr {:id        (name (first col))
                                             :name      (name (first col))
                                             :maxlength (nth (nth col 1) 1)}
                                            ent-name col)]))

(defmethod dt->hiccup [:char :create] [col ent-name _]
  (dt->hiccup (assoc col 1 (assoc (second col) 0 :varchar)) ent-name :create))

  [(let [n (name (first col))] [:label {:for n} n]) hicc-col])

(t/ann add-required-attr [pt/form-map String pt/et-column -> pt/form-map])
(defn add-required-attr [m col]
  (if (and (< 2 (count col)) (= (nth col 2) :null))
    (merge m {:required "required"})
    m))

(defn add-value [m ent-name col]
  (merge m {:value (str "{{" ent-name "." (name (first col)) "}}")}))

(defn- wrap-with-vec-and-label [form-key col ent-name]
  (wrap-with-vec-and-label' col [form-key (-> {:id   (name (first col))
                                               :name (name (first col))}
                                              (add-required-attr col)
                                              (add-value ent-name col))]))

(t/ann ^:no-check dt->hiccup [pt/et-column Keyword -> pt/html-form-group])
(defmulti dt->hiccup
