Expand description
Auto form generation — derive a FormConfig from a Rust type
that implements FormModel, no manual field-by-field wiring.
Callers describe their model once (as a Vec<AutoField> in
form_fields), and form_from_model or the fluent
FormBuilder produce the same FormConfig the manual
engine consumes. The existing crate::admin::form renderer is
untouched — this module is purely additive.
No macros, no runtime reflection, no DB introspection. Pure typed metadata supplied by the caller.
Structs§
- Auto
Field - Declarative description of one field on a model. The caller fills
this in once per column; the converter turns it into a
FieldConfig. - Field
Override - Patch applied to a single field after auto-generation. Every
sub-field is
Option—Nonemeans “leave as the generated value”. - Form
Builder - Fluent builder that starts from an auto-generated
FormConfigand lets the caller patch individual fields. Anoverride_field(name, ...)call whosenamedoesn’t match any generated field is a silent no-op — the builder intentionally doesn’t fail on typos so it composes with optional overrides from config files.
Traits§
- Form
Model - Types that can describe their own form shape.
Functions§
- form_
from_ model - Build a
FormConfigfrom a model’sFormModelimpl. The resulting form has novalues and nohelp— overrides populate those viaFormBuilder::override_field.