xia_fields.fields.StringField
- class xia_fields.fields.StringField(regex=None, max_length=None, min_length=None, **kwargs)
Bases:
BaseField- __init__(regex=None, max_length=None, min_length=None, **kwargs)
- Parameters
regex – (optional) A string pattern that will be applied during validation
max_length – (optional) A max length that will be applied during validation
min_length – (optional) A min length that will be applied during validation
no_display (object) – The field won’t be displayed
**kwargs – Keyword arguments passed into the parent class
Methods
__init__([regex, max_length, min_length])- param regex
(optional) A string pattern that will be applied during validation
get_value(value)Get detailed value of a field
load_value(value)Get value of a field in the Document
to_db(value)Transform the data into a database compatible format
to_display(value[, lazy])Transform the data into display format
validate(value)Validate data
- get_value(value)
Get detailed value of a field
Examples
In the case of a reference, the get value will fetch the data of a reference
- load_value(value)
Get value of a field in the Document
Examples
In the case of a reference, the load value don’t fetch the data and just return the reference id
- to_db(value)
Transform the data into a database compatible format
- to_display(value, lazy: bool = True)
Transform the data into display format
- validate(value)
Validate data