2014-11-13 22:23:16 +01:00
|
|
|
from django.apps import AppConfig
|
|
|
|
|
|
|
|
|
2015-07-01 17:48:41 +02:00
|
|
|
class AssignmentsAppConfig(AppConfig):
|
2015-03-26 05:36:10 +01:00
|
|
|
name = 'openslides.assignments'
|
|
|
|
verbose_name = 'OpenSlides Assignments'
|
2015-07-01 17:48:41 +02:00
|
|
|
angular_site_module = True
|
|
|
|
angular_projector_module = True
|
2015-10-22 00:01:51 +02:00
|
|
|
js_files = ['js/assignments/base.js', 'js/assignments/site.js', 'js/assignments/projector.js']
|
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.
|
2015-06-29 12:08:15 +02:00
|
|
|
from openslides.core.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.
|
2016-02-11 11:29:19 +01:00
|
|
|
router.register(self.get_model('Assignment').get_collection_name(), AssignmentViewSet)
|
2015-11-28 00:27:14 +01:00
|
|
|
router.register('assignments/poll', AssignmentPollViewSet)
|