2014-11-13 22:23:16 +01:00
|
|
|
from django.apps import AppConfig
|
|
|
|
|
|
|
|
|
|
|
|
class AgendaAppConfig(AppConfig):
|
|
|
|
name = 'openslides.agenda'
|
|
|
|
verbose_name = 'OpenSlides Agenda'
|
|
|
|
|
|
|
|
def ready(self):
|
|
|
|
# Load main menu entry, personal info and widgets.
|
|
|
|
# Do this by just importing all from these files.
|
|
|
|
from . import main_menu, personal_info, widgets # noqa
|
|
|
|
|
|
|
|
# Import all required stuff.
|
|
|
|
from django.db.models.signals import pre_delete
|
|
|
|
from openslides.config.signals import config_signal
|
|
|
|
from openslides.projector.api import register_slide
|
|
|
|
from openslides.projector.signals import projector_overlays
|
2015-01-06 00:14:49 +01:00
|
|
|
from openslides.utils.rest_api import router
|
2014-11-13 22:23:16 +01:00
|
|
|
from .signals import agenda_list_of_speakers, setup_agenda_config, listen_to_related_object_delete_signal
|
|
|
|
from .slides import agenda_slide
|
2015-01-06 00:14:49 +01:00
|
|
|
from .views import ItemViewSet
|
2014-11-13 22:23:16 +01:00
|
|
|
|
|
|
|
# Connect signals.
|
|
|
|
config_signal.connect(setup_agenda_config, dispatch_uid='setup_agenda_config')
|
|
|
|
projector_overlays.connect(agenda_list_of_speakers, dispatch_uid='agenda_list_of_speakers')
|
|
|
|
pre_delete.connect(listen_to_related_object_delete_signal, dispatch_uid='agenda_listen_to_related_object_delete_signal')
|
|
|
|
|
|
|
|
# Register slides.
|
|
|
|
Item = self.get_model('Item')
|
|
|
|
register_slide('agenda', agenda_slide, Item)
|
2015-01-06 00:14:49 +01:00
|
|
|
|
|
|
|
# Register viewset.
|
|
|
|
router.register('agenda/item', ItemViewSet)
|