From 5dea194ed068c8ff73dd65849d92be4ee6c7097b Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Thu, 27 Oct 2005 15:28:57 -0700 Subject: [PATCH 1/1] added a many-to-many slot type, and fixed the package errors due to cutting the MEWA package darcs-hash:20051027222857-5417e-d8dcc95d3586c248297caff17825736a696ea848.gz --- src/mewa.lisp | 7 ++--- src/mewa/packages.lisp | 59 ----------------------------------- src/packages.lisp | 16 ++++++++-- src/presentations.lisp | 14 ++------- src/slot-presentations.lisp | 55 ++++++++++++++++++++++++++++++-- src/static-presentations.lisp | 5 ++- 6 files changed, 73 insertions(+), 83 deletions(-) delete mode 100644 src/mewa/packages.lisp diff --git a/src/mewa.lisp b/src/mewa.lisp index cf6ea00..c519396 100644 --- a/src/mewa.lisp +++ b/src/mewa.lisp @@ -1,4 +1,4 @@ -(in-package :mewa) +(in-package :lisp-on-lines) (defparameter *default-type* :ucw) @@ -335,8 +335,7 @@ attributes is an alist keyed on the attribute name." (setf (slot-value i 'initializedp) t) i)) -(defmethod make-presentation ((list list) &key (type :listing) (initargs nil)) - +(defmethod make-presentation ((list list) &key (type :listing) (initargs nil)) (let ((args (append `(:type ,type) `(:initargs @@ -379,7 +378,7 @@ attributes is an alist keyed on the attribute name." (defaction cancel-save-instance ((self mewa)) (cond - ((instance-is-stored-p (instance self)) + ((meta-model::persistentp (instance self)) (meta-model::update-instance-from-records (instance self)) (answer self)) (t (answer nil)))) diff --git a/src/mewa/packages.lisp b/src/mewa/packages.lisp deleted file mode 100644 index ebdf210..0000000 --- a/src/mewa/packages.lisp +++ /dev/null @@ -1,59 +0,0 @@ -(defpackage :mewa - (:use :ucw :common-lisp :arnesi :iterate) - (:export - :mewa - :editablep - - ;object presentations - :present - :foreign-key-slot-presentation - :mewa-object-presentation - :mewa-one-line-presentation - :mewa-list-presentation - :mewa-presentation-search - - ;;Slot Presentations - :defslot-presentation - :slot-presentation - :mewa-slot-presentation - - :present-slot - :presentation-slot-value - - - :mewa-relation-slot-presentation - :has-a-slot-presentation - :has-a - :has-many-slot-presentation - :has-many - :has-very-many-slot-presentation - :has-very-many - :slot-name - - ;attributes - :define-attributes - :with-default-attributes - :find-attribute - :find-attribute-slot - :set-default-attributes - :make-presentation - :call-presentation - :label - :attributes - :set-attribute - :set-attribute-properties - :perform-set-attributes - :perform-set-attribute-properties - :find-class-attributes - :default-attributes - :ok - :instance - :edit-instance - :save-instance - :cancel-save-instance - :ensure-instance-sync - :instance-is-stored-p - :global-properties - :search-expr - :search-query)) - diff --git a/src/packages.lisp b/src/packages.lisp index 1db3466..eb31876 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -1,6 +1,14 @@ (defpackage :lisp-on-lines - (:use :mewa :meta-model :common-lisp :it.bese.ucw :js :clsql) - (:nicknames :lol) + (:use :arnesi + :iterate + :meta-model + :common-lisp + :it.bese.ucw + :clsql) + (:shadowing-import-from + :iterate + :with) + (:nicknames :lol :mewa) (:export ;;;; LoL :define-view-for-table @@ -39,11 +47,13 @@ :mewa-object-presentation :mewa-one-line-presentation :mewa-list-presentation - + :mewa-search-presentation + :mewa-presentation-search ;; SLOT presentations :defslot-presentation :slot-name :mewa-relation-slot-presentation + :mewa-string-slot-presentation :has-many-slot-presentation :present-slot ;; CRUD diff --git a/src/presentations.lisp b/src/presentations.lisp index 82f18e3..77510a8 100644 --- a/src/presentations.lisp +++ b/src/presentations.lisp @@ -1,16 +1,6 @@ -(in-package :mewa) +(in-package :lisp-on-lines) - - (defun split-list (n list) - (loop for cons on list - by #'(lambda (x) (nthcdr n x)) - if (< 0 n) - collect (loop for atom in cons - repeat n - collect atom) - else return nil)) - (defaction edit-instance ((self mewa)) (call-presentation (instance self) :type :editor)) @@ -126,7 +116,7 @@ (defgeneric search-expr (criteria instance) (:documentation "Return ready to apply criteria. - What to do with it is backend dependent.")) + to do with What it is backend dependent.")) (defmacro def-search-expr (((self criteria-type)) (model-expr &body body)) `(defmethod search-expr ((,self ,criteria-type) instance) diff --git a/src/slot-presentations.lisp b/src/slot-presentations.lisp index 952196f..3757ee3 100644 --- a/src/slot-presentations.lisp +++ b/src/slot-presentations.lisp @@ -1,4 +1,4 @@ -(in-package :mewa) +(in-package :lisp-on-lines) (defun multiple-value-funcall->list (function &rest args) "The function to be called by m-v-bf" @@ -194,6 +194,7 @@ Calendar.setup({ (if (slot-boundp slot 'ucw::place) (cond ((editablep slot) + (render) (