Welcome | Get started | Dive into Lino | Contribute | Topics | Reference | More

Hide individual fields

Instead of just disabling a field, you may want to hide it altogether. You do this either by calling the hide_elements() method, or by setting the hidden_elements attribute on a model or an actor.

Unlike disabling fields, hiding them happens once and for all during site startup.

class lino.core.model.Model
hide_elements(self, *names):

Mark the named data elements (fields) as hidden. They remain in the database but are not visible in the user interface.

hidden_elements = frozenset()

If specified, this is the default value for hidden_elements of every Table on this model.

For example the hide_region option of the lino_xl.lib.countries plugin uses this to

class lino.core.actors.Actor
hidden_elements = frozenset()

A set of names of layout elements which are hidden by default.

The default is an empty set except for lino.core.dbtables.Table where this will be populated from hidden_elements of the lino.core.model.Model.

Note that these names are not being verified to be names of existing fields. This fact is being used by UNION tables like lino_xl.lib.vat.IntracomInvoices