Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino.core.store

Defines the “store” and its “fields” .

During startup, Lino instantiates a “store” and its “fields” (aka “atomizers”) for every table. These were used originally for dealing with Sencha ExtJS GridPanels and FormPanels, but the concept turned out useful for other features.

Some usages specific to Sencha ExtJS:

  • for generating the JS code of the GridPanel definition

  • for generating an “atomized” JSON representation when rendering data for that GridPanel

  • for parsing the JSON sent by GridPanel and FormPanel

Other usages:

Classes

BaseStore()

ParameterStore(params_layout_handle, url_param)

Store(rh, **options)

A Store is the collection of StoreFields for a given actor.

class lino.core.store.Store(rh, **options)

Bases: BaseStore

A Store is the collection of StoreFields for a given actor. Instantiated in kernel

collect_fields(fields, *layouts)

fields is a pointer to either self.detail_fields or self.grid_fields. Each of these must contain a primary key field.

form2obj(ar, form_values, instance, is_new)

Store the form_values into the instance by calling form2obj() for every store field.

column_index(name)

Used to set disabled_actions_index. Was used to write definition of Ext.ensible.cal.CalendarMappings and Ext.ensible.cal.EventMappings