OpenSlides/openslides/mediafile/apps.py
Norman Jäckel 4f04223e08 Added Django's application configuration.
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.
2014-12-10 17:16:58 +01:00

25 lines
902 B
Python

from django.apps import AppConfig
class MediafileAppConfig(AppConfig):
name = 'openslides.mediafile'
verbose_name = 'OpenSlides Mediafile'
def ready(self):
# Load main menu entry and widgets.
# Do this by just importing all from these files.
from . import main_menu, widgets # noqa
# Import all required stuff.
from openslides.projector.api import register_slide
from openslides.utils.signals import template_manipulation
from .slides import mediafile_presentation_as_slide
from .template import add_mediafile_stylesheets
# Connect template signal.
template_manipulation.connect(add_mediafile_stylesheets, dispatch_uid='add_mediafile_stylesheets')
# Register slides.
Mediafile = self.get_model('Mediafile')
register_slide('mediafile', mediafile_presentation_as_slide, Mediafile)