From 598f1fa8d4a53d8b531ee283b69bba52f3a4bd13 Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Wed, 2 Nov 2005 23:23:50 -0800 Subject: [PATCH 1/1] fixed the macros a little darcs-hash:20051103072350-5417e-5bc0a7953cf70ee8ce02ff086b449df26be845b4.gz --- src/lisp-on-lines.lisp | 13 +++++++------ src/mewa.lisp | 2 +- src/packages.lisp | 9 +++++++++ src/presentations.lisp | 1 - 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/lisp-on-lines.lisp b/src/lisp-on-lines.lisp index bcd20e5..ca00bc5 100644 --- a/src/lisp-on-lines.lisp +++ b/src/lisp-on-lines.lisp @@ -42,19 +42,20 @@ This involves creating a meta-model, a clsql view-class, and the setting up the `(:initargs '(,@ (mapcan #'identity args))))))) -(defmethod make-view (object &rest args &key (type :viewer) (attributes nil) +(defmethod make-view (object &rest args &key (type :viewer) &allow-other-keys ) - (warn "~A ~A ~A" attributes type object) - (remf args :type ) - (remf args :attributes) - (apply #'make-presentation object (cddr (%make-view object type attributes args)))) + (remf args :type) + ;(warn "~A ~A" args `(:type ,type :initargs ,@args)) + (apply #'make-presentation object `(:type ,type ,@ (when args + `(:initargs ,args))))) (defmacro present-view ((object &optional (type :viewer) (parent 'self)) &body attributes-and-args) (arnesi:with-unique-names (view) `(let ((,view (lol:make-view ,object :type ,type - :attributes ,(car attributes-and-args) + ,@(when (car attributes-and-args) + `(:attributes ',(car attributes-and-args))) ,@ (cdr attributes-and-args)))) (setf (ucw::parent ,view) ,parent) (lol:present ,view)))) diff --git a/src/mewa.lisp b/src/mewa.lisp index 76d3c5d..be27094 100644 --- a/src/mewa.lisp +++ b/src/mewa.lisp @@ -318,7 +318,7 @@ attributes is an alist keyed on the attribute name." (defmethod make-presentation ((object t) &key (type :viewer) (initargs nil)) - + ;(warn "Initargs : ~A" initargs) (let* ((p (make-instance 'mewa-object-presentation)) (a (progn (setf (slot-value p 'instance) object) diff --git a/src/packages.lisp b/src/packages.lisp index eb31876..ebff621 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -49,6 +49,9 @@ :mewa-list-presentation :mewa-search-presentation :mewa-presentation-search + + :editablep + :global-properties ;; SLOT presentations :defslot-presentation :slot-name @@ -56,6 +59,12 @@ :mewa-string-slot-presentation :has-many-slot-presentation :present-slot + + :has-a + :has-many + :has-very-many + :many-to-many + ;; CRUD :instance-is-stored-p diff --git a/src/presentations.lisp b/src/presentations.lisp index 77510a8..aea3afd 100644 --- a/src/presentations.lisp +++ b/src/presentations.lisp @@ -1,6 +1,5 @@ (in-package :lisp-on-lines) - (defaction edit-instance ((self mewa)) (call-presentation (instance self) :type :editor)) -- 2.20.1