Source code for jmb.core.admin.dashboard

"""
Dashboard
=========

utility to register a dashboard to be used when creating the main project dashboard

.. autofunction:: register_group

.. autofunction:: get_group



"""
from admin_tools.dashboard  import modules

registry = {}

[docs]def register_group(app_name, group): """Register an :class:`admin_tools.dashboard.modules.Group` group to be :param app_name: the application name, e.g.: jmb.fax :param group: an instance of a :class:`modules.Group`. It can also be """ msg = "group must be DashboardModule or Group, found %s" assert isinstance(group, modules.DashboardModule), msg % group registry[app_name] = group
[docs]def get_group(app_name): """return a :class:`modules.Group` for app_name or None :param app_name: the application name, e.g.: jmb.fax """ return registry.get(app_name, None)