2014-11-13 22:23:16 +01:00
|
|
|
from django.apps import AppConfig
|
|
|
|
|
|
|
|
|
|
|
|
class AssignmentAppConfig(AppConfig):
|
2015-03-26 05:36:10 +01:00
|
|
|
name = 'openslides.assignments'
|
|
|
|
verbose_name = 'OpenSlides Assignments'
|
2014-11-13 22:23:16 +01:00
|
|
|
|
|
|
|
def ready(self):
|
2015-06-24 22:11:54 +02:00
|
|
|
# Load projector elements.
|
|
|
|
# Do this by just importing all from these files.
|
|
|
|
from . import projector # noqa
|
|
|
|
|
2014-11-13 22:23:16 +01:00
|
|
|
# Import all required stuff.
|
|
|
|
from openslides.config.signals import config_signal
|
2015-01-17 14:25:05 +01:00
|
|
|
from openslides.utils.rest_api import router
|
2014-11-13 22:23:16 +01:00
|
|
|
from .signals import setup_assignment_config
|
2015-06-14 23:26:06 +02:00
|
|
|
from .views import AssignmentViewSet, AssignmentPollViewSet
|
2014-11-13 22:23:16 +01:00
|
|
|
|
|
|
|
# Connect signals.
|
|
|
|
config_signal.connect(setup_assignment_config, dispatch_uid='setup_assignment_config')
|
|
|
|
|
2015-01-17 14:25:05 +01:00
|
|
|
# Register viewsets.
|
2015-03-26 05:36:10 +01:00
|
|
|
router.register('assignments/assignment', AssignmentViewSet)
|
2015-06-14 23:26:06 +02:00
|
|
|
router.register('assignments/assignmentpoll', AssignmentPollViewSet)
|