django-orchestra-test/orchestra/contrib/tasks/apps.py

17 lines
611 B
Python
Raw Permalink Normal View History

from django.apps import AppConfig
2015-05-09 18:53:23 +00:00
from django.utils.module_loading import autodiscover_modules
from orchestra.core import administration
class TasksConfig(AppConfig):
name = 'orchestra.contrib.tasks'
verbose_name = "Tasks"
def ready(self):
from djcelery.models import PeriodicTask, TaskState, WorkerState
administration.register(TaskState, icon='Edit-check-sheet.png')
administration.register(PeriodicTask, parent=TaskState, icon='Appointment.png')
administration.register(WorkerState, parent=TaskState, dashboard=False)
2015-05-09 18:53:23 +00:00
autodiscover_modules('tasks')