Books
The books model allows you to keep track of books and their authors. This is a fairly simple model, yet more complex than the To Do List model.












- Model Code
- '(:title "Books & Authors" :name "books" :version "0.1" :domain "books.demo.data-ui.com" :domain-stg "books-stg.demo.data-ui.com" :repl t :guest-allowed t :guest-auto nil :api-roles ("logged-in" "public") :landing-page :books :types (:books (:table t :create :auto :update :auto :delete :auto :display t :type-roles ("books-user" "public") :views (:main (:tables (:books :book-authors :authors :ratings :covers)) :authors (:tables (:authors))) :fields (:covers (:type :list :ui (:label "Cover" :widget :image-list) :source (:view :main :table :covers :column :name :agg :distinct)) :title (:type :text :identity t :sortable t :searchable t :ui (:label "Title" :widget :textbox) :validations (:required) :source (:view :main :column :title :agg :first) :column t :not-null t :unique t) :genre (:type :text :searchable t :sortable t :ui (:label "Genre" :widget :textbox) :source (:view :main :column :genre :agg :first) :column t :not-null nil :unique nil) :isbn (:type :text :searchable t :sortable t :ui (:label "ISBN" :widget :textbox) :validations (:required) :source (:view :main :column :isbn :agg :first) :column t :not-null t :unique t) :description (:type :text :searchable t :ui (:label "Description" :widget :textarea) :source (:view :main :column :description :agg :first) :column t) :rating (:type :integer :ui (:label "My Rating" :widget :stars) :validations ((:in-range :min 1 :max 5)) :source (:view :main :table :ratings :column :rating :scope :user :agg :first) :write-to (:table :ratings :book :this :user :user :rating :value)) :average-rating (:type :real :ui (:label "Rating" :widget :stars :read-only t :precision 1) :source (:view :main :table :ratings :column :rating :agg :avg)) :authors (:type :list :ui (:label "Authors" :widget :checkbox-list) :validations (:join-items-exist) :source (:view :main :table :authors :column :name :agg :distinct) :source-all (:view :authors :table :authors :column :name :agg :list) :join-table :book-authors) :published (:type :timestamp :ui (:label "Published") :source (:view :main :table :books :column :published :agg :first) :column t)) :list-form (:fields (:covers :title :isbn :description :average-rating :authors :published)) :update-form (:fields t) :add-form (:fields (:title :isbn :description :rating :authors :published))) :authors (:table t :create :auto :update :auto :delete :auto :display t :type-roles ("books-user" "public") :views (:main (:tables (:authors :book-authors :books)) :books (:tables (:books))) :fields (:name (:type :text :identity t :ui (:label "Name" :widget :textbox) :validations (:required) :source (:view :main :column :name :agg :first) :column t :not-null t :unique t) :books (:type :list :ui (:label "Books" :widget :checkbox-list) :validations (:join-items-exist) :source (:view :main :table :books :column :title :agg :distinct) :source-all (:view :books :table :books :column :title :agg :list) :join-table :book-authors)) :list-form (:fields t) :update-form (:fields t) :add-form (:fields t)) :ratings (:table t :create :auto :update :auto :delete :auto :display t :type-roles ("books-user" "public") :views (:main (:tables (:ratings :books :users) :scope :user) :books (:tables (:books)) :users (:tables (:users) :scope :user)) :fields (:book (:type :text :identity t :force-sql-name "rating_book" :ui (:label "Book" :widget :select) :target :books :source (:view :main :table :books :column :title :agg :first) :source-all (:view :books :table :books :column :title :agg :list) :column t :not-null t) :user (:type :text :identity t :autofill :user :force-sql-name "rating_user" :ui (:label "User" :widget :textbox :read-only t) :target :users :source (:view :main :table :users :column :name :agg :first) :source-all (:view :users :table :users :column :name :agg :list) :column t :not-null t) :rating (:type :integer :ui (:label "Rating" :widget :stars) :validations ((:in-range :min 1 :max 5)) :source (:view :main :table :ratings :column :rating :agg :first) :column t)) :list-form (:fields t) :update-form (:fields t) :add-form (:fields t)) :directories (:table t :create :auto :update :auto :delete :auto :display t :tree t :is-leaf nil :parent-type :directories :fs-backed t :type-roles ("directories-user" "public") :views (:main (:tables (:directories))) :fields (:name (:type :text :identity t :path t :ui (:label "Directory" :widget :textbox) :validations (:required) :source (:view :main :column :name :agg :first) :column t :not-null t :unique t)) :list-form (:fields t) :update-form (:fields t) :add-form (:fields t)) :covers (:table t :create :auto :update :auto :delete :auto :display t :tree t :is-leaf t :parent-type :directories :fs-backed t :type-roles ("books-user" "public") :views (:main (:tables (:covers :books)) :books (:tables (:books))) :fields (:image (:type :text :ui (:label "Image" :widget :image) :source (:view :main :column :name :agg :first) :column nil) :name (:type :text :identity t :path t :ui (:label "File" :widget :textbox) :validations (:required) :source (:view :main :column :name :agg :first) :column t :not-null t :unique t) :file (:type :file :ui (:label "Select File" :widget :file) :validations (:required)) :book (:type :text :force-sql-name "cover_book" :ui (:label "Book" :widget :select) :target :books :source (:view :main :table :books :column :title :agg :first) :source-all (:view :books :table :books :column :title :agg :list) :column t :not-null t :unique nil)) :list-form (:fields t) :update-form (:fields t) :add-form (:fields t)) :book-authors (:table t :is-joiner t :internal t :fields (:reference (:target :books) :reference (:target :authors))) :users (:type-roles ("logged-in" "public" "user-creator")) :roles (:type-roles ("logged-in" "public" "role-creator")) :permissions (:type-roles ("logged-in" "public" "permission-creator"))))
- Rating
- 5.0
- Deploy Model Status
- failed: deployer role required
- Generate Model Status
- failed: ai-user role required
- Owner
- admin
- Images
- /books.png, /books-sorted.png, /books-search.png, /books-search-sorted.png, /books-selected-chip.png, /books-by-rating.png, /books-by-rating-count.png, /books-authors.png, /books-permissions.png, /books-roles.png, /books-users-sorted.png, /books-users.png