Model-config web apps: describe the app in configuration instead of writing code. Built on Polars and DuckDB.
categories_crud.yaml · 1006 bytes · 59 lines
| 1 | # DBBasic Blog Template - Categories |
| 2 | resource: categories |
| 3 | database: blog.db |
| 4 | |
| 5 | fields: |
| 6 | id: |
| 7 | type: primary_key |
| 8 | name: |
| 9 | type: string |
| 10 | required: true |
| 11 | unique: true |
| 12 | max_length: 100 |
| 13 | searchable: true |
| 14 | slug: |
| 15 | type: string |
| 16 | unique: true |
| 17 | max_length: 100 |
| 18 | description: |
| 19 | type: text |
| 20 | ui: |
| 21 | component: textarea |
| 22 | rows: 3 |
| 23 | color: |
| 24 | type: string |
| 25 | default: "#007bff" |
| 26 | ui: |
| 27 | component: color_picker |
| 28 | icon: |
| 29 | type: string |
| 30 | ui: |
| 31 | component: icon_picker |
| 32 | post_count: |
| 33 | type: integer |
| 34 | default: 0 |
| 35 | ui: |
| 36 | readonly: true |
| 37 | created_at: |
| 38 | type: timestamp |
| 39 | auto_now_add: true |
| 40 | |
| 41 | hooks: |
| 42 | before_create: generate_slug_from_name |
| 43 | after_create: update_navigation_menu |
| 44 | after_update: invalidate_category_cache |
| 45 | after_delete: reassign_orphaned_posts |
| 46 | |
| 47 | permissions: |
| 48 | create: admin_only |
| 49 | read: public |
| 50 | update: admin_only |
| 51 | delete: admin_only |
| 52 | |
| 53 | ui: |
| 54 | theme: bootstrap |
| 55 | components: |
| 56 | list: |
| 57 | variant: card-columns |
| 58 | form: |
| 59 | variant: simple |