gws.plugin.model_field.text

Text field.

A scalar field for strings. Without a configured widget, the field uses an input widget.

With textSearch, the field takes part in keyword searches of database models. The keyword is compared with the column value cast to a string:

  • exact: the value equals the keyword,

  • any, begin, end: the keyword occurs anywhere, at the start or at the end of the value; % and _ in the keyword are matched literally,

  • like: the keyword is used as an SQL LIKE pattern as is.

The pattern match is case-insensitive (ILIKE) unless caseSensitive is set. Keywords shorter than minLength are ignored.

Example:

fields+ {
    name "name"
    type "text"
    textSearch { type "begin" minLength 2 }
}

Source code: gws.plugin.model_field.text

Package Contents

class gws.plugin.model_field.text.Config

Bases: gws.base.model.scalar_field.Config

Field for text values.

textSearch: gws.TextSearchOptions | None

Keyword search options for the field.

class gws.plugin.model_field.text.Object

Bases: gws.base.model.scalar_field.Object

Text field object.

attributeType
textSearch: gws.TextSearchOptions | None

Keyword search options, or None if the field is not searchable.

before_select(mc)
configure()
configure_widget()
class gws.plugin.model_field.text.Props

Bases: gws.base.model.scalar_field.Props