From: drewc Date: Mon, 20 Jun 2005 18:06:38 +0000 (-0700) Subject: added rollback functionality to cancel X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/commitdiff_plain/1679abef7f7f18250837d49052d92e2f8ba2f6db?hp=a6644385238aac1694af714e321c34456bea3441 added rollback functionality to cancel darcs-hash:20050620180638-39164-98e8c03962ca9d2fb6268d5117fdaac4be1171ae.gz --- diff --git a/src/mewa/mewa.lisp b/src/mewa/mewa.lisp index e384f74..ba7d6d9 100644 --- a/src/mewa/mewa.lisp +++ b/src/mewa/mewa.lisp @@ -89,13 +89,17 @@ attributes is an alist keyed on the attribute nreeame." (append (mapcar #'(lambda (s) (cons (car s) (gen-pslot - (if (meta-model:foreign-key-p model - 'ucw::foreign-key - (car s)) - (cadr s)) - (string (car s)) (car s)))) - (meta-model:list-slot-types model)) - (mapcar #'(lambda (s) (cons s (append (gen-pslot 'ucw::has-many (string s) s) `(:presentation (make-presentation ,model :type :one-line))))) + (if (meta-model:foreign-key-p model (car s)) + 'ucw::foreign-key + (cadr s)) + (string (car s)) (car s)))) + (meta-model:list-slot-types model)) + (mapcar #'(lambda (s) + (cons s (append (gen-pslot 'ucw::has-many (string s) s) + `(:presentation + (make-presentation + ,model + :type :one-line))))) (meta-model:list-has-many model)))) (defmethod set-default-attributes ((model t)) @@ -269,7 +273,11 @@ attributes is an alist keyed on the attribute nreeame." (defaction cancel-save-instance ((self mewa)) - (answer nil)) + (cond + ((slot-value (instance self) 'clsql-sys::view-database) + (meta-model::update-instance-from-records (instance self)) + (answer self)) + (t (answer nil)))) (defaction save-instance ((self mewa)) (meta-model:sync-instance (instance self))