 
 (def db
   {:var (str "tosi:" (rand-int 10))
-   :start 10
+   :start 0
    :editing {}})
 
 (defn ^:export updatedb [fields value]

(defn update_field [id value]
  (set! db (assoc-in db [:editing id] value)))

(defn save []
  (println "Saved!" (str (:editing db))))

(defn clear []
  (updatedb [:editing] {})
  (println "Cleared!"))

;
; View


(defn notes [data start]
  "Returns 10 items from data"
  (map-indexed
    (fn [i item]
      (let [title (get item "title")]
          (m "li" nil [(m "button" {:onclick #(edit item i)} "Edit")
                       title])))
    (take PAGESIZE (drop start data))))

(defn page [start direction count]
