OpenSlides/openslides/core/apps.py
Norman Jäckel dc7d27a985 Added REST API for projector. Introduced new projector API.
Added custom slide projector element class.
Added welcome slide as custom slide.
Added user slide projector element class.
Added clock, countdown ans message projector elements.
Renamed SignalConnectMetaClass classmethod get_all_objects to get_all (private API).
Added migrations to core app.
Fixed and wrote tests.
Updated CHANGELOG.
2015-05-29 12:44:25 +02:00

37 lines
1.4 KiB
Python

from django.apps import AppConfig
class CoreAppConfig(AppConfig):
name = 'openslides.core'
verbose_name = 'OpenSlides Core'
def ready(self):
# Load main menu entry, projector elements and widgets.
# Do this by just importing all from these files.
from . import main_menu, projector, widgets # noqa
# Import all required stuff.
from django.db.models import signals
from openslides.config.signals import config_signal
from openslides.utils.autoupdate import inform_changed_data_receiver
from openslides.utils.rest_api import router
from .signals import setup_general_config
from .views import CustomSlideViewSet, ProjectorViewSet, TagViewSet
# Connect signals.
config_signal.connect(setup_general_config, dispatch_uid='setup_general_config')
# Register viewsets.
router.register('core/projector', ProjectorViewSet)
router.register('core/customslide', CustomSlideViewSet)
router.register('core/tag', TagViewSet)
# Update data when any model of any installed app is saved or deleted.
# TODO: Test if the m2m_changed signal is also needed.
signals.post_save.connect(
inform_changed_data_receiver,
dispatch_uid='inform_changed_data_receiver')
signals.post_delete.connect(
inform_changed_data_receiver,
dispatch_uid='inform_changed_data_receiver')