From 5a4eea119b2c7d1c5a3bbd374e8a26e0b5e1d04f Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Wed, 31 Aug 2005 14:42:51 -0700 Subject: [PATCH] fixes to conform with new meta-model darcs-hash:20050831214251-5417e-c30fa5067268d1822d0fd07c09097eddb82dbeb1.gz --- src/lisp-on-lines.lisp | 2 +- src/mewa/mewa.lisp | 7 +++++-- src/packages.lisp | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lisp-on-lines.lisp b/src/lisp-on-lines.lisp index 7658722..81a33c9 100644 --- a/src/lisp-on-lines.lisp +++ b/src/lisp-on-lines.lisp @@ -16,7 +16,7 @@ Generates a form that, when evaluated, initialises the given table as an lol obj This involves creating a meta-model, a clsql view-class, and the setting up the default attributes for a mewa presentation" `(progn - (def-view-class/table ,table) + (def-view-class-from-table ,table) (set-default-attributes (quote ,(meta-model::sql->sym table)))))) (defmacro initialize-lol-for-table (&rest tables) diff --git a/src/mewa/mewa.lisp b/src/mewa/mewa.lisp index 785f05d..b09d594 100644 --- a/src/mewa/mewa.lisp +++ b/src/mewa/mewa.lisp @@ -236,7 +236,10 @@ attributes is an alist keyed on the attribute name." (defmethod find-slot-presentation-for-attribute ((self mewa) attribute) (let ((class-name - (or (gethash (second attribute) ucw::*slot-type-mapping*) + (or (gethash (if (consp (second attribute)) + (car (second attribute)) + (second attribute)) + ucw::*slot-type-mapping*) (error "Can't find slot type for ~A" (second attribute))))) (cons (first attribute) (apply #'make-instance @@ -265,7 +268,7 @@ attributes is an alist keyed on the attribute name." (initialize-slots p) (assoc type (find-all-attributes p)))) ;;;; TODO: this can be cleaned up, probably CHANGE-CLASS is better here - (i (apply #'change-class p (or (second a) + (i (apply #'make-instance (or (second a) ;; if we didnt find the type, ;; use the symbol as a class. (if (eql (symbol-package type) diff --git a/src/packages.lisp b/src/packages.lisp index da10eed..27b9ae4 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -107,7 +107,8 @@ :instance-is-stored-p ;;;; Meta Model Exports)) - :def-view-class/table + :define-meta-model + :def-view-class-from-table :def-view-class/meta :list-slot-types )) \ No newline at end of file -- 2.20.1