bootstack.FieldItem#
- class bootstack.FieldItem(key, label=None, dtype=None, readonly=False, required=False, visible=True, column=None, row=None, columnspan=1, rowspan=1, editor=None, editor_options=<factory>, type='field')#
Bases:
objectA single field in a
Form, addressed by itskey.- dtype: DType = None#
Type hint controlling the default editor —
'str','int','float','bool','date','datetime', or'password'.Noneinfers the type from the initial value.
- editor: EditorType | None = None#
Force a specific editor widget (see
EditorType).Noneinfers it fromdtype.
- editor_options: dict[str, Any]#
Extra keyword arguments forwarded to the editor widget. For
'select', pass{"values": ["A", "B", "C"]}; add{"allow_custom_values": True}for an editable combobox.
- required: bool = False#
Mark the field as required — adds a
'required'validation rule and appends an asterisk to the label. Honored by the text, number, password, date, and select editors; has no effect on boolean or slider editors. DefaultFalse.
- type: Literal['field'] = 'field'#
Item-type discriminator. Set automatically; only needed when building items as plain dicts.