Rename statistics app to mayan_statistics to avoid library class
with Python3 statistics app. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -164,9 +164,9 @@ source_file = mayan/apps/sources/locale/en/LC_MESSAGES/django.po
|
|||||||
type = PO
|
type = PO
|
||||||
|
|
||||||
[mayan-edms.statistics-2-0]
|
[mayan-edms.statistics-2-0]
|
||||||
file_filter = mayan/apps/statistics/locale/<lang>/LC_MESSAGES/django.po
|
file_filter = mayan/apps/mayan_statistics/locale/<lang>/LC_MESSAGES/django.po
|
||||||
source_lang = en
|
source_lang = en
|
||||||
source_file = mayan/apps/statistics/locale/en/LC_MESSAGES/django.po
|
source_file = mayan/apps/mayan_statistics/locale/en/LC_MESSAGES/django.po
|
||||||
type = PO
|
type = PO
|
||||||
|
|
||||||
[mayan-edms.storage-2-0]
|
[mayan-edms.storage-2-0]
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ APP_LIST = (
|
|||||||
'acls', 'appearance', 'authentication', 'cabinets', 'checkouts', 'common',
|
'acls', 'appearance', 'authentication', 'cabinets', 'checkouts', 'common',
|
||||||
'converter', 'django_gpg', 'document_comments', 'document_indexing',
|
'converter', 'django_gpg', 'document_comments', 'document_indexing',
|
||||||
'document_parsing', 'document_signatures', 'document_states', 'documents',
|
'document_parsing', 'document_signatures', 'document_states', 'documents',
|
||||||
'dynamic_search', 'events', 'linking', 'lock_manager', 'mailer',
|
'dynamic_search', 'events', 'linking', 'lock_manager', 'mayan_statistics',
|
||||||
'metadata', 'mirroring', 'motd', 'navigation', 'ocr', 'permissions',
|
'mailer', 'metadata', 'mirroring', 'motd', 'navigation', 'ocr', 'permissions',
|
||||||
'rest_api', 'smart_settings', 'sources', 'statistics', 'storage', 'tags',
|
'rest_api', 'smart_settings', 'sources', 'storage', 'tags', 'task_manager',
|
||||||
'task_manager', 'user_management'
|
'user_management'
|
||||||
)
|
)
|
||||||
|
|
||||||
LANGUAGE_LIST = (
|
LANGUAGE_LIST = (
|
||||||
|
|||||||
3
mayan/apps/mayan_statistics/__init__.py
Normal file
3
mayan/apps/mayan_statistics/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
default_app_config = 'mayan_statistics.apps.StatisticsApp'
|
||||||
@@ -20,8 +20,9 @@ from .tasks import task_execute_statistic # NOQA - Force registration of task
|
|||||||
|
|
||||||
|
|
||||||
class StatisticsApp(MayanAppConfig):
|
class StatisticsApp(MayanAppConfig):
|
||||||
|
app_namespace = 'statistics'
|
||||||
has_tests = True
|
has_tests = True
|
||||||
name = 'statistics'
|
name = 'mayan_statistics'
|
||||||
verbose_name = _('Statistics')
|
verbose_name = _('Statistics')
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
@@ -46,7 +47,7 @@ class StatisticsApp(MayanAppConfig):
|
|||||||
|
|
||||||
app.conf.CELERY_ROUTES.update(
|
app.conf.CELERY_ROUTES.update(
|
||||||
{
|
{
|
||||||
'statistics.tasks.task_execute_statistic': {
|
'mayan_statistics.tasks.task_execute_statistic': {
|
||||||
'queue': 'statistics'
|
'queue': 'statistics'
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -51,10 +51,12 @@ class Statistic(object):
|
|||||||
app_label='djcelery', model_name='PeriodicTask'
|
app_label='djcelery', model_name='PeriodicTask'
|
||||||
)
|
)
|
||||||
StatisticResult = apps.get_model(
|
StatisticResult = apps.get_model(
|
||||||
app_label='statistics', model_name='StatisticResult'
|
app_label='mayan_statistics', model_name='StatisticResult'
|
||||||
)
|
)
|
||||||
|
|
||||||
queryset = PeriodicTask.objects.filter(name__startswith='statistics.').exclude(name__in=Statistic.get_task_names())
|
queryset = PeriodicTask.objects.filter(
|
||||||
|
name__startswith='mayan_statistics.'
|
||||||
|
).exclude(name__in=Statistic.get_task_names())
|
||||||
|
|
||||||
for periodic_task in queryset:
|
for periodic_task in queryset:
|
||||||
crontab_instance = periodic_task.crontab
|
crontab_instance = periodic_task.crontab
|
||||||
@@ -94,7 +96,7 @@ class Statistic(object):
|
|||||||
app.conf.CELERYBEAT_SCHEDULE.update(
|
app.conf.CELERYBEAT_SCHEDULE.update(
|
||||||
{
|
{
|
||||||
self.get_task_name(): {
|
self.get_task_name(): {
|
||||||
'task': 'statistics.tasks.task_execute_statistic',
|
'task': 'mayan_statistics.tasks.task_execute_statistic',
|
||||||
'schedule': self.schedule,
|
'schedule': self.schedule,
|
||||||
'args': (self.slug,)
|
'args': (self.slug,)
|
||||||
},
|
},
|
||||||
@@ -118,7 +120,7 @@ class Statistic(object):
|
|||||||
self.store_results(results=self.func())
|
self.store_results(results=self.func())
|
||||||
|
|
||||||
def get_task_name(self):
|
def get_task_name(self):
|
||||||
return 'statistics.task_execute_statistic_{}'.format(self.slug)
|
return 'mayan_statistics.task_execute_statistic_{}'.format(self.slug)
|
||||||
|
|
||||||
def store_results(self, results):
|
def store_results(self, results):
|
||||||
from .models import StatisticResult
|
from .models import StatisticResult
|
||||||
@@ -9,6 +9,6 @@ queue_statistics = CeleryQueue(
|
|||||||
)
|
)
|
||||||
|
|
||||||
queue_statistics.add_task_type(
|
queue_statistics.add_task_type(
|
||||||
name='statistics.tasks.task_execute_statistic',
|
name='mayan_statistics.tasks.task_execute_statistic',
|
||||||
label=_('Execute statistic')
|
label=_('Execute statistic')
|
||||||
)
|
)
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
default_app_config = 'statistics.apps.StatisticsApp'
|
|
||||||
@@ -94,13 +94,13 @@ INSTALLED_APPS = (
|
|||||||
# 'folders',
|
# 'folders',
|
||||||
'linking',
|
'linking',
|
||||||
'mailer',
|
'mailer',
|
||||||
|
'mayan_statistics',
|
||||||
'metadata',
|
'metadata',
|
||||||
'mirroring',
|
'mirroring',
|
||||||
'motd',
|
'motd',
|
||||||
'ocr',
|
'ocr',
|
||||||
'rest_api',
|
'rest_api',
|
||||||
'sources',
|
'sources',
|
||||||
'statistics',
|
|
||||||
'storage',
|
'storage',
|
||||||
'tags',
|
'tags',
|
||||||
'task_manager',
|
'task_manager',
|
||||||
|
|||||||
Reference in New Issue
Block a user