Move diagnostics, statistics and maintenance functions from the main app into separate apps

This commit is contained in:
Roberto Rosario
2012-07-27 01:06:56 -04:00
parent f8d94be59d
commit 4fad1c3305
24 changed files with 170 additions and 87 deletions

11
apps/diagnostics/api.py Normal file
View File

@@ -0,0 +1,11 @@
from common.utils import reverse_lazy
diagnostics = {}
def register_diagnostic(namespace, title, link):
namespace_dict = diagnostics.get(namespace, {'title': None, 'links': []})
namespace_dict['title'] = title
link.url = getattr(link, 'url', reverse_lazy(link.view))
namespace_dict['links'].append(link)
diagnostics[namespace] = namespace_dict