Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
* Save filepath with document for easier inspection
* Small bugfix whereby all the clients and registrants were thought to
  be the same being.
  • Loading branch information
Zack Maril committed Jul 22, 2014
1 parent 30e493c commit 21c7d56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/echelon/core.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
(map second) (map second)
(filter #(< 1 (count %))) (filter #(< 1 (count %)))
(map (partial map first)) (map (partial map first))
disjoint-lists
(mapcat (partial merges-for-beings dbc)) (mapcat (partial merges-for-beings dbc))
(d/with dbc) (d/with dbc)
:db-after)] :db-after)]
Expand Down
25 changes: 4 additions & 21 deletions src/echelon/load.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@


:lobbying.form/source :lobbying.form/sopr-html :lobbying.form/source :lobbying.form/sopr-html
:lobbying.form/document-id (:document_id m) :lobbying.form/document-id (:document_id m)
:lobbying.form/filepath f


:lobbying.form/amendment :lobbying.form/amendment
(-> m :registration_type :amendment) (-> m :registration_type :amendment)
Expand Down Expand Up @@ -111,7 +112,7 @@
(let [r (:registrant m)] (let [r (:registrant m)]
{:record/type :lobbying.record/registrant {:record/type :lobbying.record/registrant
:record/represents :record/represents
(if (m :client :client_self) (if (-> m :client :client_self)
client-being-id client-being-id
registrant-being-id) registrant-being-id)
:lobbying.registrant/name (:registrant_name r) :lobbying.registrant/name (:registrant_name r)
Expand Down Expand Up @@ -233,7 +234,8 @@
(doseq [datoms (doseq [datoms
(map (comp (map (comp
registration-datoms registration-datoms
(juxt identity (comp #(json/read-str % :key-fn keyword) slurp))) (juxt (memfn getPath)
(comp #(json/read-str % :key-fn keyword) slurp)))
(list-registration-forms)) (list-registration-forms))
:when (not (contains-nil? datoms))] :when (not (contains-nil? datoms))]
@(d/transact conn datoms))) @(d/transact conn datoms)))
Expand All @@ -246,22 +248,3 @@
(load-schema! conn) (load-schema! conn)
(println "Data loading...") (println "Data loading...")
(load-data! conn)) (load-data! conn))

(comment
(->> (list-registration-forms)
(map (comp #(json/read-str % :key-fn keyword)
slurp))
(filter (comp not empty? :affiliated_organizations) )
first
; (vector "")
;registration-datoms
))

(comment
(doseq [form (list-registration-forms)
:when (-> form
slurp
(json/read-str :key-fn keyword)
(#(registration-datoms ["" %] ))
contains-nil?)]
(println form)))

0 comments on commit 21c7d56

Please sign in to comment.