oshipka/bootstrap/webapp/view_models/Example.yaml_

40 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-07-08 14:38:55 +02:00
# RENAME THIS FILE TO .yaml and use the structure below
#
name: Example # name of the model
searchable: # list of columns that are searchable
- body
2020-08-11 14:35:25 +02:00
interits: # list of inheritable classes, each line is one of (Ownable)
2020-07-08 14:38:55 +02:00
- Ownable
access:
- verb: all
login_required: true
roles_required:
- admin
2021-05-08 12:24:13 +02:00
- verb: get|list|table|search|create|update|delete
2020-07-08 14:38:55 +02:00
login_required: false
2021-05-08 12:24:13 +02:00
show_in_nav: yes
2020-07-08 14:38:55 +02:00
columns:
2021-05-08 12:24:13 +02:00
- name: body|is_<bool>|<date>_dt
2021-05-08 14:14:54 +02:00
type: boolean|integer|text|long_text|datetime
2021-05-08 12:24:13 +02:00
default: "{}"
2021-05-08 14:14:54 +02:00
- name: filesomething
type: file|audio|video|picture|image|img
accept: .doc,.docx # OPTIONAL: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept
2021-05-08 12:24:13 +02:00
- name: related
type: relationship # type relationship
2021-05-08 14:14:54 +02:00
to: other_model # OPTIONAL: otherwise we get it from the name
backref: backref_model # OPTIONAL: name of the backref model, otherwise from name
foreign_key: fk_1 # OPTIONAL: MUST do it, if several related to the same column
2021-05-08 12:24:13 +02:00
multiple: true # could be many-to-many
- name: choisy
type: choice
choices:
INT_INFO: int_info # key:value
2021-05-08 14:14:54 +02:00
backrefs:
- name: related_to
model: song # list of backrefs that should be displayed
resolve: '.song_to' # OPTIONAL: in case it's a additional table that needs to be resolved further
2021-05-08 12:24:13 +02:00
display:
primary: type
secondary: text
tertiary: alt_names