askrobots / dbbasic Public

Model-config web apps: describe the app in configuration instead of writing code. Built on Polars and DuckDB.

0 downloads

dbbasic/templates/blog/categories_crud.yaml
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Add DBBasic crate engine logo and update README 0d628db 1 year, 2 months ago History
categories_crud.yaml · 1006 bytes · 59 lines
1# DBBasic Blog Template - Categories
2resource: categories
3database: blog.db
4
5fields:
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
41hooks:
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
47permissions:
48 create: admin_only
49 read: public
50 update: admin_only
51 delete: admin_only
52
53ui:
54 theme: bootstrap
55 components:
56 list:
57 variant: card-columns
58 form:
59 variant: simple