RecTypes and Records
Describe data in YAML. Cardinal gives you tables, views, an API and permissions.
A RecType describes a kind of data. A Record is one row of it. An app keeps its RecTypes as YAML in rectypes/:
schema: 1
name: Project
module: Projects
title_field: project_name
fields:
- {fieldname: project_name, fieldtype: Data, label: Name, in_list_view: true}
- {fieldname: owner_user, fieldtype: Link, label: Lead, options: User}
- {fieldname: status, fieldtype: Select, label: Status, options: "Open\nClosed", in_standard_filter: true}
- {fieldname: budget, fieldtype: Currency, label: Budget}
permissions:
- {role: System Manager, rights: [read, write, create, delete, report]}
- {role: All, if_owner: true, rights: [read, write]}cardinal meta check validates every app's RecType, permission and website files.
What you get
- A table in each tenant's schema that has the app installed.
- List, form and report views in the desk with no frontend code, plus Kanban, calendar, Gantt, map and tree views when the RecType has the fields they need.
GET,POST,PUTandDELETEon/api/rec/Project, with permission checks on every path.
Where to go next
| Topic | Page |
|---|---|
| Save, submit, cancel and amend | Record lifecycle |
| How a new Record gets its name | Naming |
permissions, permlevel and if_owner | Permissions |
| Changing an app's RecType for one site | Customization |
depends_on and other conditions | Expressions |