summaryrefslogtreecommitdiff
path: root/lib/model/data_list.mli
blob: e74bf23506e888592edc3356d4dd821c4d0a041e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(** A static list declared in the configuration.

    Unlike contents, lists are not editable by the user: their entries are
    loaded by the data provider (from a file or any other source, which is not
    part of the model) and they can only be referenced from fields.

    Lists have their own fields, declared directly under the ["field"] key of
    the list — unlike contents, there is no section grouping them. The fields
    use the same {!Field.t} as the content fields; the only restriction is that
    a reference field in a list can only target another list, declared before it
    (a list cannot reference itself or a later list). *)

type 'a t = {
  id : Identifier.t;
      (** Name of the list; usable as the target of a reference field, and as
          the name of its dedicated table in the database *)
  fields : 'a Field.t list;  (** The fields of each entry of the list *)
}