Expand description
Descriptor-driven create and edit forms.
A FormConfig describes a table and its editable fields. Generic handlers
render an empty form (new), a populated form (edit), and persist through a
crate::persist::Persister: the descriptor-driven default (a parameterized
insert/update over the form’s columns), or a named handler for a custom write.
A submission is checked by the framework validation engine
(laterite_core::validation); a failure re-renders the form with per-field
messages instead of writing.
Field types resolve through the registry (crate::field); text,
textarea, select, and reference ship built-in. Fields needing a typed
stored value (a switch over a bool column, password hashing) arrive with the
typed-save contract.
The primary key is a bigint auto-increment column the database assigns, so
create inserts only the descriptor’s fields and never sets the id. An entity
with other required columns that lack defaults (for example audit timestamps)
is beyond this slice; those are filled by a later timestamp-aware widget.
Structs§
- Form
Config - A form descriptor: which table, its editable fields, the id column, and the
base path the form lives under (
{base_path}/new,{base_path}/{id}/edit). - Form
Field - One editable field: the column, its label, its field-type key (resolved through the field-type registry), typed options for that type, the validation rules it carries, and whether it holds translatable content. A serde descriptor, so it is authorable as data (later YAML) as well as by builder.