diff implementations/meredith/methods.lisp @ 225:6f0881af3403

add composition slot to event (meredith) Ignore-this: d6b133f7d17684bf3f7c1ccde28c7d8a darcs-hash:20090828164631-16a00-1a25e46b8142401466f4a6ec7159a10d8e31de40.gz committer: Jamie Forth <j.forth@gold.ac.uk>
author j.forth <j.forth@gold.ac.uk>
date Thu, 24 Feb 2011 11:23:18 +0000
parents 4eceac78e7c6
children 7412629f5c78
line wrap: on
line diff
--- a/implementations/meredith/methods.lisp	Thu Feb 24 11:23:18 2011 +0000
+++ b/implementations/meredith/methods.lisp	Thu Feb 24 11:23:18 2011 +0000
@@ -22,22 +22,25 @@
   (let* ((composition-id (composition-id identifier))
 	 (where-clause [= [composition-id] composition-id])
 	 (description
-	  (car (clsql:select [description] :from [|meredith-compositions|]
-			     :where where-clause :flatp t :field-names nil)))
+	  (car (clsql:select [description]
+			     :from [|meredith-compositions|]
+			     :where where-clause
+			     :flatp t
+			     :field-names nil
+			     :database *amuse-database*)))
+	 (composition (make-meredith-composition
+		       :identifier identifier
+		       :description description))
 	 (db-events (apply #'clsql:select
                            (append *event-attributes*
                                    (list :from [|meredith-events|]
                                          :order-by '(([event-id] :asc))
-                                         :where where-clause))))
-         (events nil))
-    (dolist (e db-events)
-      (push (db-event->meredith-event e) events))
-    (let* ((composition
-	    (make-meredith-composition :identifier identifier
-				       :description description)))
-      (sequence:adjust-sequence composition (length events)
- 				:initial-contents (nreverse events))
-      composition))
+                                         :where where-clause
+					 :database *amuse-database*))))
+         (events (loop for e in db-events
+		    collect (db-event->meredith-event e composition))))
+    (sequence:adjust-sequence composition (length events)
+			      :initial-contents events))
   #.(clsql:locally-disable-sql-reader-syntax))
 
 (defmethod copy-event (event)