4f04223e08
Used customized AppConfig classes in openslides.core, openslides.account, openslides.projector, openslides.agenda, openslides.motion, openslides.assignment, openslides.users, openslides.mediafile, openslides.config. Refactored loading of signals, template signals and slides.
29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
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
|
|
from .signals import agenda_list_of_speakers, setup_agenda_config, listen_to_related_object_delete_signal
|
|
from .slides import agenda_slide
|
|
|
|
# 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)
|