1 (in-package :lisp-on-lines
)
6 ;;;; This file contains the high level functions and macros
7 ;;;; that are part of LoL proper, that is to say, not Mewa
10 ;;;; ** Initialisation
11 ;;;; The following macros are used to initialise a set of database tables as LoL objects.
12 (eval-when (:compile-toplevel
:load-toplevel
:execute
)
13 (defun generate-initialize-lol-for-table (table)
15 Generates a form that, when evaluated, initialises the given table as an lol object.
16 This involves creating a meta-model, a clsql view-class, and the setting up the default attributes for a mewa presentation"
19 (def-view-class/table
,table
)
20 (set-default-attributes (quote ,(meta-model::sql-
>sym table
))))))
22 (defmacro initialize-lol-for-table
(&rest tables
)
23 " expand to a form which initialises TABLES for use with LOL"
25 ,@(loop for tbl in tables collect
(generate-initialize-lol-for-table tbl
))
28 (defmacro initialize-lol-for-database
()
29 "expands to init-i-f-t using the listing of tables provided by meta-model"
30 `(initialize-lol-for-table ,@(meta-model::list-tables
)))