OpenSlides/openslides/mediafiles/apps.py
Oskar Hahn 0b5f75339e Rename apps and permissions
* Fixed agenda permissions
* Renamed assignment to assignments, fixed assignments permission names
* Renamed mediafile to mediafiles
* Renamed motion to motions. Fixed motions permission names
2015-03-29 20:35:53 +02:00

30 lines
1.1 KiB
Python

from django.apps import AppConfig
class MediafileAppConfig(AppConfig):
name = 'openslides.mediafiles'
verbose_name = 'OpenSlides Mediafiles'
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.rest_api import router
from openslides.utils.signals import template_manipulation
from .slides import mediafile_presentation_as_slide
from .template import add_mediafile_stylesheets
from .views import MediafileViewSet
# 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)
# Register viewsets.
router.register('mediafiles/mediafile', MediafileViewSet)