Add app menu entries from the registry
This commit is contained in:
@@ -1,22 +1,13 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import inspect
|
||||
#import runpy
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import transaction, DatabaseError
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.importlib import import_module
|
||||
|
||||
from .models import App
|
||||
|
||||
#from navigation.api import bind_links, register_model_list_columns
|
||||
|
||||
#from .links import (app_registry_tool_link, app_list, backup_tool_link,
|
||||
# restore_tool_link, backup_job_list, backup_job_create, backup_job_edit,
|
||||
# backup_job_test)
|
||||
|
||||
#bind_links(['app_list'], [app_list], menu_name='secondary_menu')
|
||||
###app.set_backup([ModelBackup()])
|
||||
|
||||
for app_name in settings.INSTALLED_APPS:
|
||||
|
||||
@@ -18,6 +18,7 @@ from smart_settings import SettingsNamespace
|
||||
from project_setup.api import register_setup
|
||||
from project_tools.api import register_tool
|
||||
from statistics.api import register_statistics
|
||||
from navigation.api import register_top_menu
|
||||
|
||||
#from .classes import AppBackup, StorageModuleBase, Setting
|
||||
|
||||
@@ -90,8 +91,13 @@ class App(TranslatableLabelMixin, LiveObjectMixin, models.Model):
|
||||
register_tool(link)
|
||||
|
||||
for statistic in getattr(registration, 'statistics', []):
|
||||
logger.debug('stattistic: %s' % statistic)
|
||||
logger.debug('statistic: %s' % statistic)
|
||||
register_statistics(statistic)
|
||||
|
||||
for index, link in enumerate(getattr(registration, 'menu_links', [])):
|
||||
logger.debug('menu_link: %s' % link)
|
||||
register_top_menu(name='%s.%s' % (app_name, index), link=link)
|
||||
|
||||
|
||||
#def set_backup(self, *args, **kwargs):
|
||||
# return AppBackup(self, *args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user