Backport statistics app, remove statistic code from the main app, convert the documents and ocr apps to use the new statictics app code

This commit is contained in:
Roberto Rosario
2014-07-04 01:46:16 -04:00
parent 74388515d9
commit d19f3da730
39 changed files with 1555 additions and 61 deletions

View File

@@ -14,6 +14,7 @@ from navigation.api import (register_links, register_top_menu,
register_model_list_columns, register_multi_item_links,
register_sidebar_template)
from project_setup.api import register_setup
from statistics.classes import StatisticNamespace
from .conf import settings as document_settings
from .conf.settings import THUMBNAIL_SIZE
@@ -44,6 +45,7 @@ from .permissions import (
PERMISSION_DOCUMENT_DELETE, PERMISSION_DOCUMENT_DOWNLOAD,
PERMISSION_DOCUMENT_TRANSFORM, PERMISSION_DOCUMENT_EDIT,
PERMISSION_DOCUMENT_VERSION_REVERT, PERMISSION_DOCUMENT_NEW_VERSION)
from .statistics import DocumentStatistics, DocumentUsageStatistics
from .widgets import document_thumbnail
# History setup
@@ -145,3 +147,7 @@ document_search.add_model_field('versions__pages__content', label=_(u'Content'))
document_search.add_model_field('description', label=_(u'Description'))
document_search.add_model_field('tags__name', label=_(u'Tags'))
document_search.add_related_field('comments', 'Comment', 'comment', 'object_pk', label=_(u'Comments'))
namespace = StatisticNamespace(name='documents', label=_(u'Documents'))
namespace.add_statistic(DocumentStatistics(name='document_stats', label=_(u'Document tendencies')))
namespace.add_statistic(DocumentUsageStatistics(name='document_usage', label=_(u'Document usage')))

View File

@@ -4,9 +4,10 @@ from django.utils.translation import ugettext_lazy as _
from django.db.models import Avg, Count, Min, Max
from common.utils import pretty_size, pretty_size_10
from statistics.classes import Statistic
from .runtime import storage_backend
from .models import Document, DocumentType, DocumentPage, DocumentVersion
from .runtime import storage_backend
def get_used_size(path, file_list):
@@ -37,19 +38,38 @@ def storage_count(path=u'.'):
return total_count, total_size
def get_statistics():
class DocumentStatistics(Statistic):
def get_results(self):
results = []
results.extend([
_(u'Document types: %d') % DocumentType.objects.count(),
])
document_stats = DocumentVersion.objects.annotate(page_count=Count('pages')).aggregate(Min('page_count'), Max('page_count'), Avg('page_count'))
results.extend([
_(u'Minimum amount of pages per document: %d') % (document_stats['page_count__min'] or 0),
_(u'Maximum amount of pages per document: %d') % (document_stats['page_count__max'] or 0),
_(u'Average amount of pages per document: %f') % (document_stats['page_count__avg'] or 0),
])
return results
class DocumentUsageStatistics(Statistic):
def get_results(self):
results = []
total_db_documents = Document.objects.only('pk',).count()
paragraphs = [
_(u'Document types: %d') % DocumentType.objects.count(),
results.extend([
_(u'Documents in database: %d') % total_db_documents,
]
])
try:
total_storage_documents, storage_used_space = storage_count()
paragraphs.append(_(u'Documents in storage: %d') %
results.append(_(u'Documents in storage: %d') %
total_storage_documents)
paragraphs.append(_(u'Space used in storage: %(base_2)s (base 2), %(base_10)s (base 10), %(bytes)d bytes') % {
results.append(_(u'Space used in storage: %(base_2)s (base 2), %(base_10)s (base 10), %(bytes)d bytes') % {
'base_2': pretty_size(storage_used_space),
'base_10': pretty_size_10(storage_used_space),
'bytes': storage_used_space
@@ -57,17 +77,8 @@ def get_statistics():
except NotImplementedError:
pass
document_stats = DocumentVersion.objects.annotate(page_count=Count('pages')).aggregate(Min('page_count'), Max('page_count'), Avg('page_count'))
paragraphs.extend(
[
results.extend([
_(u'Document pages in database: %d') % DocumentPage.objects.only('pk',).count(),
_(u'Minimum amount of pages per document: %d') % (document_stats['page_count__min'] or 0),
_(u'Maximum amount of pages per document: %d') % (document_stats['page_count__max'] or 0),
_(u'Average amount of pages per document: %f') % (document_stats['page_count__avg'] or 0),
]
)
])
return {
'title': _(u'Document statistics'),
'paragraphs': paragraphs
}
return results

View File

@@ -8,7 +8,7 @@ from project_setup.api import register_setup
from project_tools.api import register_tool
from .conf.settings import SIDE_BAR_SEARCH, DISABLE_HOME_VIEW
from .links import (admin_site, diagnostics, maintenance_menu, sentry, statistics)
from .links import admin_site, diagnostics, maintenance_menu, sentry
if not DISABLE_HOME_VIEW:
register_top_menu('home', link={'text': _(u'home'), 'view': 'home', 'famfam': 'house'}, position=0)
@@ -18,9 +18,8 @@ if not SIDE_BAR_SEARCH:
if 'django.contrib.admin' in settings.INSTALLED_APPS:
register_setup(admin_site)
register_tool(maintenance_menu)
register_tool(statistics)
register_tool(diagnostics)
register_tool(maintenance_menu)
if 'sentry' in settings.INSTALLED_APPS:
register_tool(sentry)

View File

@@ -6,7 +6,6 @@ def is_superuser(context):
maintenance_menu = {'text': _(u'maintenance'), 'view': 'maintenance_menu', 'famfam': 'wrench', 'icon': 'wrench.png'}
statistics = {'text': _(u'statistics'), 'view': 'statistics', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser, 'children_view_regex': [r'statistics']}
diagnostics = {'text': _(u'diagnostics'), 'view': 'diagnostics', 'famfam': 'pill', 'icon': 'pill.png'}
sentry = {'text': _(u'sentry'), 'view': 'sentry', 'famfam': 'bug', 'icon': 'bug.png', 'condition': is_superuser}
admin_site = {'text': _(u'admin site'), 'view': 'admin:index', 'famfam': 'keyboard', 'icon': 'keyboard.png', 'condition': is_superuser}

View File

@@ -3,6 +3,5 @@ from django.conf.urls import patterns, url
urlpatterns = patterns('main.views',
url(r'^$', 'home', (), 'home'),
url(r'^maintenance_menu/$', 'maintenance_menu', (), 'maintenance_menu'),
url(r'^statistics/$', 'statistics', (), 'statistics'),
url(r'^diagnostics/$', 'diagnostics_view', (), 'diagnostics'),
)

View File

@@ -7,8 +7,6 @@ from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from documents.statistics import get_statistics as documents_statistics
from ocr.statistics import get_statistics as ocr_statistics
from permissions.models import Permission
from .api import diagnostics, tools
@@ -45,21 +43,6 @@ def maintenance_menu(request):
context_instance=RequestContext(request))
def statistics(request):
if request.user.is_superuser or request.user.is_staff:
blocks = []
blocks.append(documents_statistics())
blocks.append(ocr_statistics())
return render_to_response('statistics.html', {
'blocks': blocks,
'title': _(u'Statistics')
},
context_instance=RequestContext(request))
else:
raise PermissionDenied
def diagnostics_view(request):
return render_to_response('diagnostics.html', {
'blocks': diagnostics,

View File

@@ -13,6 +13,7 @@ from main.api import register_maintenance_links
from navigation.api import register_links, register_multi_item_links
from project_tools.api import register_tool
from scheduler.api import register_interval_job
from statistics.classes import StatisticNamespace
from . import models as ocr_models
from .conf.settings import (AUTOMATIC_OCR, QUEUE_PROCESSING_INTERVAL)
@@ -25,6 +26,7 @@ from .links import (submit_document, submit_document_multiple,
from .literals import QUEUEDOCUMENT_STATE_PENDING, QUEUEDOCUMENT_STATE_PROCESSING
from .models import DocumentQueue
from .permissions import PERMISSION_OCR_DOCUMENT
from .statistics import OCRStatistics
from .tasks import task_process_document_queues
logger = logging.getLogger(__name__)
@@ -76,3 +78,6 @@ class_permissions(Document, [
])
reset_queue_documents()
namespace = StatisticNamespace(name='ocr', label=_(u'OCR'))
namespace.add_statistic(OCRStatistics(name='ocr_stats', label=_(u'OCR queue statistics')))

View File

@@ -2,16 +2,18 @@ from __future__ import absolute_import
from django.utils.translation import ugettext as _
from statistics.classes import Statistic
from .models import DocumentQueue, QueueDocument
def get_statistics():
paragraphs = [
class OCRStatistics(Statistic):
def get_results(self):
results = []
results.extend([
_(u'Document queues: %d') % DocumentQueue.objects.count(),
_(u'Queued documents: %d') % QueueDocument.objects.only('pk').count()
]
])
return {
'title': _(u'OCR statistics'),
'paragraphs': paragraphs
}
return results

View File

@@ -0,0 +1,10 @@
from __future__ import absolute_import
from navigation.api import register_links, register_model_list_columns
from .classes import Statistic, StatisticNamespace
from .links import link_execute, link_namespace_details, link_namespace_list
register_links(StatisticNamespace, [link_namespace_details])
register_links([StatisticNamespace, 'statistics:namespace_list', 'statistics:execute'], [link_namespace_list], menu_name='secondary_menu')
register_links(Statistic, [link_execute])

View File

@@ -0,0 +1,58 @@
class StatisticNamespace(object):
_registry = {}
@classmethod
def get_all(cls):
return cls._registry.values()
@classmethod
def get(cls, name):
return cls._registry[name]
def __init__(self, name, label):
self.name = name
self.label = label
self._statistics = []
self.__class__._registry[name] = self
def __unicode__(self):
return unicode(self.label)
def add_statistic(self, statistic):
self._statistics.append(statistic)
statistic.namespace = self
@property
def id(self):
return self.name
@property
def statistics(self):
return self._statistics
class Statistic(object):
_registry = {}
@classmethod
def get_all(cls):
return cls._registry.values()
@classmethod
def get(cls, name):
return cls._registry[name]
def __init__(self, name, label):
self.name = name
self.label = label
self.__class__._registry[name] = self
def __unicode__(self):
return unicode(self.label)
def get_results(self, *args, **kwargs):
return NotImplemented
@property
def id(self):
return self.name

View File

@@ -0,0 +1,13 @@
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
def is_superuser(context):
return context['request'].user.is_staff or context['request'].user.is_superuser
link_execute = {'text': _(u'execute'), 'view': 'statistics:execute', 'args': 'object.id', 'famfam': 'lightning', 'condition': is_superuser}
link_namespace_details = {'text': _(u'details'), 'view': 'statistics:namespace_details', 'args': 'namespace.id', 'famfam': 'chart_curve_go', 'condition': is_superuser}
link_namespace_list = {'text': _(u'namespace list'), 'view': 'statistics:namespace_list', 'famfam': 'chart_curve', 'condition': is_superuser, 'children_view_regex': [r'statistics']}
link_statistics = {'text': _(u'Statistics'), 'view': 'statistics:namespace_list', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser, 'children_view_regex': [r'statistics']}

View File

@@ -0,0 +1,62 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,62 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,61 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,62 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,60 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-04 01:46-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: links.py:10
msgid "execute"
msgstr ""
#: links.py:11
msgid "details"
msgstr ""
#: links.py:12
msgid "namespace list"
msgstr ""
#: links.py:13 registry.py:7
msgid "Statistics"
msgstr ""
#: registry.py:8
msgid "Central place to store and display app statistics."
msgstr ""
#: views.py:18
msgid "statistics namespaces"
msgstr ""
#: views.py:34
#, python-format
msgid "namespace details for: %s"
msgstr ""
#: views.py:35 views.py:49
msgid "namespace"
msgstr ""
#: views.py:50
msgid "statistic"
msgstr ""
#: views.py:54
#, python-format
msgid "results for: %s"
msgstr ""

View File

@@ -0,0 +1,9 @@
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from .links import link_statistics
label = _(u'Statistics')
description = _(u'Central place to store and display app statistics.')
tool_links = [link_statistics]

View File

Before

Width:  |  Height:  |  Size: 1021 B

After

Width:  |  Height:  |  Size: 1021 B

View File

@@ -0,0 +1,7 @@
from django.conf.urls import patterns, url
urlpatterns = patterns('statistics.views',
url(r'^$', 'namespace_list', name='namespace_list'),
url(r'^namespace/(?P<namespace_id>\w+)/details/$', 'namespace_details', name='namespace_details'),
url(r'^(?P<statistic_id>\w+)/execute/$', 'execute', name='execute'),
)

View File

@@ -0,0 +1,55 @@
from __future__ import absolute_import
from django.core.exceptions import PermissionDenied
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from .classes import Statistic, StatisticNamespace
def namespace_list(request):
if not request.user.is_superuser or not request.user.is_staff:
raise PermissionDenied
return render_to_response('generic_list.html', {
'object_list': StatisticNamespace.get_all(),
'hide_link': True,
'title': _(u'statistics namespaces'),
'list_object_variable_name': 'namespace',
}, context_instance=RequestContext(request))
def namespace_details(request, namespace_id):
if not request.user.is_superuser or not request.user.is_staff:
raise PermissionDenied
namespace = StatisticNamespace.get(namespace_id)
return render_to_response('generic_list.html', {
'object': namespace,
'namespace': namespace,
'object_list': namespace.statistics,
'hide_link': True,
'title': _(u'namespace details for: %s') % namespace,
'object_name': _(u'namespace'),
}, context_instance=RequestContext(request))
def execute(request, statistic_id):
if not request.user.is_superuser or not request.user.is_staff:
raise PermissionDenied
statictic = Statistic.get(statistic_id)
return render_to_response('generic_list.html', {
'object': statictic,
'namespace': statictic.namespace,
'navigation_object_list': [
{'object': 'namespace', 'name': _(u'namespace')},
{'object': 'object', 'name': _(u'statistic')},
],
'object_list': statictic.get_results(),
'hide_link': True,
'title': _(u'results for: %s') % statictic,
}, context_instance=RequestContext(request))

View File

@@ -81,6 +81,7 @@ INSTALLED_APPS = (
'tags',
'document_comments',
'metadata',
'statistics',
'documents',
'linking',
'document_indexing',

View File

@@ -37,6 +37,7 @@ urlpatterns = patterns('',
(r'^scheduler/', include('scheduler.urls')),
(r'^bootstrap/', include('bootstrap.urls')),
(r'^registration/', include('registration.urls')),
(r'^statistics/', include('statistics.urls', namespace='statistics')),
)