added perform-set-attribute and a few other fixes to this builds again.
authordrewc <drewc@tech.coop>
Thu, 30 Jun 2005 09:39:09 +0000 (02:39 -0700)
committerdrewc <drewc@tech.coop>
Thu, 30 Jun 2005 09:39:09 +0000 (02:39 -0700)
darcs-hash:20050630093909-39164-011982c5a8283c8108b063bffa1ef214c0d07342.gz

src/meta-model.lisp
src/mewa/mewa.lisp
src/packages.lisp

index 58b3fd4..dead63e 100644 (file)
@@ -52,8 +52,9 @@
 
 (defmacro def-base-class (name (model) &rest args)
   (let ((i (make-instance model)))
-    `(prog1
-         (eval ,(def-base-class-expander i name args))
+   `(progn
+      (eval-when (:compile-toplevel :load-toplevel :execute)
+       ,(def-base-class-expander i :clsql name args))
        (defmethod meta-model.metadata ((m ,name))
         ',(meta-model.metadata i)))))
   
index 16a08e5..e440551 100644 (file)
@@ -90,6 +90,9 @@ attributes is an alist keyed on the attribute nreeame."
                         (cddr (find-attribute model name))))
            definition)))
 
+(defmethod perform-set-attributes ((model t) definitions)
+  (dolist (def definitions)
+    (funcall #'set-attribute model (first def) (rest def))))
 
 (defmethod default-attributes ((model t))
   "return the default attributes for a given model using the meta-model's meta-data"
@@ -290,12 +293,6 @@ attributes is an alist keyed on the attribute nreeame."
        (answer self))
 
 
-(defaction ok ((self mewa) &optional arg)
-  "Returns the component if it has not been modified. if it has been, prompt user to save or cancel"
-  (declare (ignore arg))
-  (ensure-instance-sync self)
-  (answer self))
-
 (defaction ensure-instance-sync ((self mewa))
   (when (modifiedp self)
     (let ((message (format nil "Record has been modified, Do you wish to save the changes?<br/> ~a" (print (modifications self)))))
@@ -308,6 +305,14 @@ attributes is an alist keyed on the attribute nreeame."
        (:save 
         (save-instance self))))))
 
+(defaction ok ((self mewa) &optional arg)
+  "Returns the component if it has not been modified. if it has been, prompt user to save or cancel"
+  (declare (ignore arg))
+  (ensure-instance-sync self)
+  (answer self))
+
+
+
 
 
 (defmethod (setf presentation-slot-value) :around (value (slot slot-presentation) instance)
index 0fd0c87..839feba 100644 (file)
@@ -58,7 +58,8 @@
    :make-presentation 
    :call-presentation 
    :label 
-   :set-attribute 
+   :set-attribute
+   :perform-set-attributes
    :find-class-attributes 
    :default-attributes 
    :ok