Skip to main content

Fields configuration

Classic vs SmartFields#

Classic fields represent columns in the table, while SmartFields are additional fields calculated while loading an entity (example : the age of a player is calculated from its birthday column). The SmartFields identifiers should start by smart_ and are not calculated while loading the list tables.

Definition#

Each field of a table should be defined in the fields property of the entities configuration.

first_name:
label:
en: First name
fr: Prénom
displayTable: true
color:
label:
en: Color
fr: Couleur
displayTable: true
widget: color
birthday:
label:
en: Birthday
fr: Date de naissance
displayTable: false
shirt_number:
label:
en: Shirt number
fr: Numéro de maillot
displayTable: false
nationality_id:
label:
en: Nationality
fr: Nationalité
displayTable: true
smart_current_age:
label:
en: Age
fr: Âge
smartQuery: cast(strftime('%Y.%m%d', 'now') - strftime('%Y.%m%d', birthday) as int)
smartType: integer
PropertyRequiredUsage
first_nameyesAn unique identifier defining the property and the field name (except for SmartFields)
labelyesA translatable property defining the field name
displayTable-Only for classic fields (columns, non-SmartFields), a boolean defining if the field should be displayed in the list tables
widget-A widget to define how the field should be displayed in the form and table. Right now, only color is supported
smartQuery-Only for SmartFields, defining the query to calculate the value of the field. Must be an SQL, Sqlite 3 compatible query
smartType-Only for SmartFields, defining the type of the field (see datatypes in Sqlite 3)