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]#
Keyword arguments for the editor widget, using its public
bs.*parameter names — e.g.{"step": 10}for anumberfield,{"show_border": True}for atextarea,{"mask": "*"}for atextfield. For'select', pass the choices as{"values": ["A", "B", "C"]}(or{"items": [...]}); 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, select, textarea, and spinner 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.