lino.core.userprefs

The user preferences registry.

Application code should get the preferences for a user by calling lino.modlib.users.User.get_preferences() which returns an object of this class.

There is one instance per user which will be created upon first request.

After instantiating a preferences object, Lino calls the setup_user_prefs of every installed plugin once on it. This feature is used by lino.modlib.dashboard).

(This module's source code is available here.)

Functions

get_available_items(user)

Return a list of all available dasboard items for this user.

Classes

Registry()

A volatile singleton which holds

UserPrefs(site, user)

A volatile object which holds the preferences of a user.

lino.core.userprefs.get_available_items(user)

Return a list of all available dasboard items for this user.

This does not call setup_user_prefs() of installed plugins.

class lino.core.userprefs.UserPrefs(site, user)

Bases: object

A volatile object which holds the preferences of a user.

dashboard_items

A list of the items to be displayed in the dashboard (see admin_main.html). Every item is an instance of DashboardItem or subclass thereof.

class lino.core.userprefs.Registry

Bases: object

A volatile singleton which holds

user_prefs

A set of (model, pk) of very locked row