-
Notifications
You must be signed in to change notification settings - Fork 4
metadata in details
Clojure-web-admin (CWA) provides features based on metadata. CWA can make most use of build-in metadata in database (e.g.,column-name,type-name ,nullable,etc.) and use extra metadata (key-value pairs separated by ‘\n’) in comments(e.g.,searchable,search-op,exportable,etc.).
The following types of metadeta are supported out of the box:
The defaule value of nullable is 1. If a column is set to not null. The value of nullable would be 0. When the value is 0,it would add a validate rule to avoid null input.
See more details in Validation
The value of column-name would determine the value of label in a form or search-box.
The value of column-name would give a default value to an input element when create an entity.
The value of column-name would determine how to render the column in a form or search-box.
See more details in form-in-details .
The defaule value is 0 and has no effects.
When set the column-name to ‘decimal’ and give it precision (e.g. decimal(5.2) ), decimal-digits is the number after the dot.
It would give a formatter rule in form input element.
[:input.form-control
{:field :numeric :fmt "%.2f"}]
When searchable is set to 1, the column would be a search condition in search-box.
Search operation. Make most use of korma`s search operations,but recently only support some of them.
Available search operation [=, like, and, or, >, <, >=, <=, in, not-in, not, not=, between]
When exportable is set to 1,the column would be export in the excel.
When column-name is ‘select’,this metadate should be specified,the value represents the logic associative table.
When column-name is ‘select’,this metadate should be specified, the value represents the column in logic associative table which would display in dropdown selections in form.
The column can not be insert/update by users.
Not shown in data grid.
Not shown in New/Edit form.
Short the original value in DB.
Specify the x-axis of bar chart
Specified the y-axis of bar chart