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:
Roberto Rosario
2017-08-29 01:33:10 -04:00
parent 69514767b6
commit 32feb98874
100 changed files with 20 additions and 17 deletions

View File

@@ -164,9 +164,9 @@ source_file = mayan/apps/sources/locale/en/LC_MESSAGES/django.po
type = PO
[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_file = mayan/apps/statistics/locale/en/LC_MESSAGES/django.po
source_file = mayan/apps/mayan_statistics/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.storage-2-0]

View File

@@ -9,10 +9,10 @@ APP_LIST = (
'acls', 'appearance', 'authentication', 'cabinets', 'checkouts', 'common',
'converter', 'django_gpg', 'document_comments', 'document_indexing',
'document_parsing', 'document_signatures', 'document_states', 'documents',
'dynamic_search', 'events', 'linking', 'lock_manager', 'mailer',
'metadata', 'mirroring', 'motd', 'navigation', 'ocr', 'permissions',
'rest_api', 'smart_settings', 'sources', 'statistics', 'storage', 'tags',
'task_manager', 'user_management'
'dynamic_search', 'events', 'linking', 'lock_manager', 'mayan_statistics',
'mailer', 'metadata', 'mirroring', 'motd', 'navigation', 'ocr', 'permissions',
'rest_api', 'smart_settings', 'sources', 'storage', 'tags', 'task_manager',
'user_management'
)
LANGUAGE_LIST = (

View File

@@ -0,0 +1,3 @@
from __future__ import unicode_literals
default_app_config = 'mayan_statistics.apps.StatisticsApp'

View File

@@ -20,8 +20,9 @@ from .tasks import task_execute_statistic # NOQA - Force registration of task
class StatisticsApp(MayanAppConfig):
app_namespace = 'statistics'
has_tests = True
name = 'statistics'
name = 'mayan_statistics'
verbose_name = _('Statistics')
def ready(self):
@@ -46,7 +47,7 @@ class StatisticsApp(MayanAppConfig):
app.conf.CELERY_ROUTES.update(
{
'statistics.tasks.task_execute_statistic': {
'mayan_statistics.tasks.task_execute_statistic': {
'queue': 'statistics'
},
}

View File

@@ -51,10 +51,12 @@ class Statistic(object):
app_label='djcelery', model_name='PeriodicTask'
)
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:
crontab_instance = periodic_task.crontab
@@ -94,7 +96,7 @@ class Statistic(object):
app.conf.CELERYBEAT_SCHEDULE.update(
{
self.get_task_name(): {
'task': 'statistics.tasks.task_execute_statistic',
'task': 'mayan_statistics.tasks.task_execute_statistic',
'schedule': self.schedule,
'args': (self.slug,)
},
@@ -118,7 +120,7 @@ class Statistic(object):
self.store_results(results=self.func())
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):
from .models import StatisticResult

View File

@@ -9,6 +9,6 @@ queue_statistics = CeleryQueue(
)
queue_statistics.add_task_type(
name='statistics.tasks.task_execute_statistic',
name='mayan_statistics.tasks.task_execute_statistic',
label=_('Execute statistic')
)

View File

@@ -1,3 +0,0 @@
from __future__ import unicode_literals
default_app_config = 'statistics.apps.StatisticsApp'

View File

@@ -94,13 +94,13 @@ INSTALLED_APPS = (
# 'folders',
'linking',
'mailer',
'mayan_statistics',
'metadata',
'mirroring',
'motd',
'ocr',
'rest_api',
'sources',
'statistics',
'storage',
'tags',
'task_manager',