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
+10
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])
+58
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
+13
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']}
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
@@ -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 ""
+9
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]
Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

+7
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'),
)
+55
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))