Text Input¶
Overview¶
Use TextInput to control text fields.
Make field¶
Collapsar will assume the field if you pass only pass 1 parameter. You can define the label and field name this way:
Computed values¶
You may use provide a function if you want to render a custom value.
from collapsar.fields.TextInput import TextInput
TextInput('Full name', lambda model: f'{model.name} {model.last_name}')
Info
Computed values cannot be edited and won't be shown on the creation form.
Validation¶
Use numeric to define a string as numeric.
max¶
Use max to set the maxlength value for a string.
min¶
Use min to set the minlength value for a string.
Info
For advanced validations see Validations.