+
+(defmethod perform-define-attributes ((model t) attributes)
+ (loop for attribute in attributes
+ do (destructuring-bind (name type &rest args)
+ attribute
+ (cond ((eq type t)
+ ;;use the existing (default) type
+ (set-attribute-properties model name args))
+ ((not (null type))
+ ;;set the type as well
+ (set-attribute model name (cons type args)))))))
+
+(defmacro define-attributes (models &body attribute-definitions)
+ `(progn
+ ,@(loop for model in models
+ collect `(perform-define-attributes (quote ,model) (quote ,attribute-definitions)))
+ (mapcar #'find-class-attributes (quote ,models ))))
+
+(defun find-presentation-attributes (model)
+ (remove nil (mapcar #'(lambda (att)
+ (when (keywordp (car att))
+ att))
+ (cdr (find-class-attributes model)))))
+
+
+;;;; ** Default Attributes
+
+
+;;;; The default mewa class contains the types use as defaults.
+;;;; maps meta-model slot-types to slot-presentation
+
+(defvar *default-attributes-class-name* 'default)
+
+(define-attributes (default)
+ (boolean mewa-boolean)
+ (string mewa-string)
+ (number mewa-currency)
+ (integer mewa-integer)
+ (currency mewa-currency)
+ (clsql:generalized-boolean mewa-boolean)
+ (foreign-key foreign-key)
+ (:viewer mewa-viewer)
+ (:editor mewa-editor)
+ (:creator mewa-creator)
+ (:one-line mewa-one-line-presentation)
+ (:listing mewa-list-presentation :global-properties (:editablep nil) :editablep t)
+ (:search-model mewa-object-presentation))
+