sync instance when adding many to many ..
authorDrew Crampsie <drewc@tech.coop>
Sat, 29 Oct 2005 13:09:03 +0000 (06:09 -0700)
committerDrew Crampsie <drewc@tech.coop>
Sat, 29 Oct 2005 13:09:03 +0000 (06:09 -0700)
darcs-hash:20051029130903-5417e-3cc24bc65c24a027166dde8c45f37e368d796a11.gz

src/mewa.lisp
src/slot-presentations.lisp

index 063775a..76d3c5d 100644 (file)
@@ -332,9 +332,6 @@ attributes is an alist keyed on the attribute name."
                                          (symbol-name type)
                                          type))
                   (plist-union initargs (cddr a)))))
                                          (symbol-name type)
                                          type))
                   (plist-union initargs (cddr a)))))
-
-    (warn "~A ~A " initargs (cddr a))
-    
     
     (setf (slot-value i 'instance) object)
     (initialize-slots i)
     
     (setf (slot-value i 'instance) object)
     (initialize-slots i)
index 95e8c8e..7827c37 100644 (file)
@@ -398,7 +398,7 @@ Calendar.setup({
   (let ((instances (slot-value instance (slot-name slot)))
        new-instance)
     (<:ul
   (let ((instances (slot-value instance (slot-name slot)))
        new-instance)
     (<:ul
-     (<:li (<ucw:a :action (add-on-many-to-many slot instance)
+     (<:li (<ucw:a :action (add-to-many-to-many slot instance)
                   (<:as-html "Add New")))
      (<:li  (<ucw:button :action (add-to-many-to-many slot instance new-instance)
                         (<:as-html "Add:"))
                   (<:as-html "Add New")))
      (<:li  (<ucw:button :action (add-to-many-to-many slot instance new-instance)
                         (<:as-html "Add:"))
@@ -416,6 +416,8 @@ Calendar.setup({
        (present-view ((car i) (list-view slot) (ucw::parent slot)))) ))))
 
 (defaction add-to-many-to-many ((slot many-to-many-slot-presentation) instance &optional foreign-instance)
        (present-view ((car i) (list-view slot) (ucw::parent slot)))) ))))
 
 (defaction add-to-many-to-many ((slot many-to-many-slot-presentation) instance &optional foreign-instance)
+  ;;;; First things first, we sync.
+  (sync-instance instance)
   (let* (new
         (imd (getf (meta-model::find-slot-metadata instance (slot-name slot))
                    :db-info))
   (let* (new
         (imd (getf (meta-model::find-slot-metadata instance (slot-name slot))
                    :db-info))