Exemplo n.º 1
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.signals import permission_change
        from openslides.utils.rest_api import router
        from .projector import register_projector_slides
        from .signals import get_permission_change_data
        from .views import MediafileViewSet
        from . import serializers  # noqa
        from ..utils.access_permissions import required_user

        # Define projector elements.
        register_projector_slides()

        # Connect signals.
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid="mediafiles_get_permission_change_data",
        )

        # Register viewsets.
        router.register(
            self.get_model("Mediafile").get_collection_string(), MediafileViewSet
        )

        # register required_users
        required_user.add_collection_string(
            self.get_model("Mediafile").get_collection_string(), required_users
        )
Exemplo n.º 2
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.signals import permission_change
        from openslides.utils.rest_api import router
        from . import serializers  # noqa
        from .signals import get_permission_change_data
        from .views import MediafileViewSet

        # Validate, that the media_url is correct formatted:
        # Must begin and end with a slash. It has to be at least "/".
        media_url = settings.MEDIA_URL
        if not media_url.startswith("/") or not media_url.endswith("/"):
            raise ImproperlyConfigured(
                "The MEDIA_URL setting must start and end with a slash")

        # Connect signals.
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid="mediafiles_get_permission_change_data",
        )

        # Register viewsets.
        router.register(
            self.get_model("Mediafile").get_collection_string(),
            MediafileViewSet)
Exemplo n.º 3
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from django.db.models.signals import pre_delete, post_save
        from openslides.core.config import config
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import (
            listen_to_related_object_post_delete,
            listen_to_related_object_post_save)
        from .views import ItemViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_save.connect(
            listen_to_related_object_post_save,
            dispatch_uid='listen_to_related_object_post_save')
        pre_delete.connect(
            listen_to_related_object_post_delete,
            dispatch_uid='listen_to_related_object_post_delete')

        # Register viewsets.
        router.register(self.get_model('Item').get_collection_string(), ItemViewSet)
Exemplo n.º 4
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.core.signals import permission_change, user_data_required
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import get_permission_change_data, is_user_data_required
        from .views import AssignmentViewSet, AssignmentPollViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='assignments_get_permission_change_data')
        user_data_required.connect(
            is_user_data_required,
            dispatch_uid='assignments_is_user_data_required')

        # Register viewsets.
        router.register(
            self.get_model('Assignment').get_collection_string(),
            AssignmentViewSet)
        router.register('assignments/poll', AssignmentPollViewSet)
Exemplo n.º 5
0
    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 django.db.models.signals import post_save
        from openslides.config.signals import config_signal
        from openslides.projector.api import register_slide_model
        from openslides.utils.rest_api import router
        from .signals import setup_users_config, user_post_save
        from .views import UserViewSet

        # Load User model.
        User = self.get_model('User')

        # Connect signals.
        config_signal.connect(setup_users_config, dispatch_uid='setup_users_config')
        post_save.connect(user_post_save, sender=User, dispatch_uid='users_user_post_save')

        # Register slides.
        register_slide_model(User, 'participant/user_slide.html')

        # Register viewsets.
        router.register('users/user', UserViewSet)
Exemplo n.º 6
0
    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 django.db.models import signals
        from openslides.config.signals import config_signal
        from openslides.projector.api import register_slide_model
        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, TagViewSet

        # Connect signals.
        config_signal.connect(setup_general_config,
                              dispatch_uid='setup_general_config')

        # Register slides.
        CustomSlide = self.get_model('CustomSlide')
        register_slide_model(CustomSlide, 'core/customslide_slide.html')

        # Register viewsets.
        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')
Exemplo n.º 7
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from django.db.models.signals import pre_delete, post_save
        from openslides.core.signals import config_signal
        from openslides.utils.rest_api import router
        from .signals import (
            setup_agenda_config,
            listen_to_related_object_post_delete,
            listen_to_related_object_post_save)
        from .views import ItemViewSet

        # Connect signals.
        config_signal.connect(setup_agenda_config, dispatch_uid='setup_agenda_config')
        post_save.connect(
            listen_to_related_object_post_save,
            dispatch_uid='listen_to_related_object_post_save')
        pre_delete.connect(
            listen_to_related_object_post_delete,
            dispatch_uid='listen_to_related_object_post_delete')

        # Register viewsets.
        router.register('agenda/item', ItemViewSet)
Exemplo n.º 8
0
    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 openslides.config.signals import config_signal
        from openslides.projector.api import register_slide_model
        from openslides.utils.rest_api import router
        from openslides.utils.signals import template_manipulation
        from .signals import setup_assignment_config
        from .template import add_assignment_stylesheets
        from .views import AssignmentViewSet

        # Connect signals.
        config_signal.connect(setup_assignment_config,
                              dispatch_uid='setup_assignment_config')

        # Connect template signal.
        template_manipulation.connect(
            add_assignment_stylesheets,
            dispatch_uid='add_assignment_stylesheets')

        # Register slides.
        Assignment = self.get_model('Assignment')
        AssignmentPoll = self.get_model('AssignmentPoll')
        register_slide_model(Assignment, 'assignment/slide.html')
        register_slide_model(AssignmentPoll,
                             'assignment/assignmentpoll_slide.html')

        # Register viewsets.
        router.register('assignment/assignment', AssignmentViewSet)
Exemplo n.º 9
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from django.db.models.signals import pre_delete, post_save
        from openslides.core.config import config
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import (
            listen_to_related_object_post_delete,
            listen_to_related_object_post_save)
        from .views import ItemViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_save.connect(
            listen_to_related_object_post_save,
            dispatch_uid='listen_to_related_object_post_save')
        pre_delete.connect(
            listen_to_related_object_post_delete,
            dispatch_uid='listen_to_related_object_post_delete')

        # Register viewsets.
        router.register(self.get_model('Item').get_collection_string(), ItemViewSet)
Exemplo n.º 10
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.signals import permission_change
        from openslides.utils.rest_api import router
        from .projector import get_projector_elements
        from .signals import get_permission_change_data
        from .views import MediafileViewSet
        from ..utils.access_permissions import required_user

        # Define projector elements.
        register_projector_elements(get_projector_elements())

        # Connect signals.
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='mediafiles_get_permission_change_data')

        # Register viewsets.
        router.register(
            self.get_model('Mediafile').get_collection_string(),
            MediafileViewSet)

        # register required_users
        required_user.add_collection_string(
            self.get_model('Mediafile').get_collection_string(),
            required_users)
Exemplo n.º 11
0
    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 openslides.utils.rest_api import router
        from .signals import agenda_list_of_speakers, setup_agenda_config, listen_to_related_object_delete_signal
        from .slides import agenda_slide
        from .views import ItemViewSet

        # 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)

        # Register viewsets.
        router.register('agenda/item', ItemViewSet)
Exemplo n.º 12
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from django.db.models import signals
        from openslides.core.signals import config_signal, post_permission_creation
        from openslides.utils.autoupdate import inform_changed_data_receiver
        from openslides.utils.rest_api import router
        from openslides.utils.search import index_add_instance, index_del_instance
        from .signals import delete_django_app_permissions, setup_general_config
        from .views import (
            ChatMessageViewSet,
            ConfigViewSet,
            CustomSlideViewSet,
            ProjectorViewSet,
            TagViewSet,
        )

        # Connect signals.
        config_signal.connect(
            setup_general_config,
            dispatch_uid='setup_general_config')
        post_permission_creation.connect(
            delete_django_app_permissions,
            dispatch_uid='delete_django_app_permissions')

        # Register viewsets.
        router.register('core/projector', ProjectorViewSet)
        router.register('core/chatmessage', ChatMessageViewSet)
        router.register('core/customslide', CustomSlideViewSet)
        router.register('core/tag', TagViewSet)
        router.register('core/config', ConfigViewSet, 'config')

        # 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')

        # Update the search when a model is saved or deleted
        signals.post_save.connect(
            index_add_instance,
            dispatch_uid='index_add_instance')
        signals.post_delete.connect(
            index_del_instance,
            dispatch_uid='index_del_instance')
        signals.m2m_changed.connect(
            index_add_instance,
            dispatch_uid='m2m_index_add_instance')
Exemplo n.º 13
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.utils.rest_api import router
        from .views import MediafileViewSet

        # Register viewsets.
        router.register(self.get_model('Mediafile').get_collection_string(), MediafileViewSet)
Exemplo n.º 14
0
    def ready(self):
        # Load main menu entry.
        # Do this by just importing all from this file.
        from . import main_menu  # noqa

        # Import all required stuff.
        from openslides.utils.rest_api import router
        from .views import ConfigViewSet

        # Register viewsets.
        router.register('config/config', ConfigViewSet, 'config')
Exemplo n.º 15
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from django.db.models import signals
        from openslides.core.signals import config_signal, post_permission_creation
        from openslides.utils.autoupdate import inform_changed_data_receiver, inform_deleted_data_receiver
        from openslides.utils.rest_api import router
        from openslides.utils.search import index_add_instance, index_del_instance
        from .signals import delete_django_app_permissions, setup_general_config
        from .views import (
            ChatMessageViewSet,
            ConfigViewSet,
            CustomSlideViewSet,
            ProjectorViewSet,
            TagViewSet,
        )

        # Connect signals.
        config_signal.connect(
            setup_general_config,
            dispatch_uid='setup_general_config')
        post_permission_creation.connect(
            delete_django_app_permissions,
            dispatch_uid='delete_django_app_permissions')

        # Register viewsets.
        router.register(self.get_model('Projector').get_collection_string(), ProjectorViewSet)
        router.register(self.get_model('ChatMessage').get_collection_string(), ChatMessageViewSet)
        router.register(self.get_model('CustomSlide').get_collection_string(), CustomSlideViewSet)
        router.register(self.get_model('Tag').get_collection_string(), TagViewSet)
        router.register(self.get_model('ConfigStore').get_collection_string(), ConfigViewSet, 'config')

        # 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_deleted_data_receiver,
            dispatch_uid='inform_deleted_data_receiver')

        # Update the search when a model is saved or deleted
        signals.post_save.connect(
            index_add_instance,
            dispatch_uid='index_add_instance')
        signals.post_delete.connect(
            index_del_instance,
            dispatch_uid='index_del_instance')
        signals.m2m_changed.connect(
            index_add_instance,
            dispatch_uid='m2m_index_add_instance')
Exemplo n.º 16
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.utils.rest_api import router
        from .views import MediafileViewSet

        # Register viewsets.
        router.register(
            self.get_model('Mediafile').get_collection_string(),
            MediafileViewSet)
Exemplo n.º 17
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.core.signals import post_permission_creation
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import (add_default_seating_plan,
                              add_permissions_to_builtin_groups)
        from .urls import urlpatterns
        from .views import (AssignmentPollKeypadConnectionViewSet,
                            KeypadViewSet, MotionPollKeypadConnectionViewSet,
                            SeatViewSet, VotecollectorViewSet)

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_permission_creation.connect(
            add_permissions_to_builtin_groups,
            dispatch_uid='votecollector_add_permissions_to_builtin_groups')
        post_permission_creation.connect(
            add_default_seating_plan,
            dispatch_uid='votecollector_add_default_seating_plan')

        # Register viewsets.
        router.register(
            self.get_model('VoteCollector').get_collection_string(),
            VotecollectorViewSet)
        router.register(
            self.get_model('Seat').get_collection_string(), SeatViewSet)
        router.register(
            self.get_model('Keypad').get_collection_string(), KeypadViewSet)
        router.register(
            self.get_model(
                'MotionPollKeypadConnection').get_collection_string(),
            MotionPollKeypadConnectionViewSet)
        router.register(
            self.get_model(
                'AssignmentPollKeypadConnection').get_collection_string(),
            AssignmentPollKeypadConnectionViewSet)

        # Provide plugin urlpatterns to application configuration
        self.urlpatterns = urlpatterns
Exemplo n.º 18
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.core.signals import post_permission_creation
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import (
            add_default_seating_plan,
            add_permissions_to_builtin_groups
        )
        from .urls import urlpatterns
        from .views import (
            AssignmentPollKeypadConnectionViewSet,
            KeypadViewSet,
            MotionPollKeypadConnectionViewSet,
            SeatViewSet,
            VotecollectorViewSet
        )

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_permission_creation.connect(
            add_permissions_to_builtin_groups,
            dispatch_uid='votecollector_add_permissions_to_builtin_groups'
        )
        post_permission_creation.connect(
            add_default_seating_plan,
            dispatch_uid='votecollector_add_default_seating_plan'
        )

        # Register viewsets.
        router.register(self.get_model('VoteCollector').get_collection_string(), VotecollectorViewSet)
        router.register(self.get_model('Seat').get_collection_string(), SeatViewSet)
        router.register(self.get_model('Keypad').get_collection_string(), KeypadViewSet)
        router.register(self.get_model('MotionPollKeypadConnection').get_collection_string(),
                        MotionPollKeypadConnectionViewSet)
        router.register(self.get_model('AssignmentPollKeypadConnection').get_collection_string(),
                        AssignmentPollKeypadConnectionViewSet)

        # Provide plugin urlpatterns to application configuration
        self.urlpatterns = urlpatterns
Exemplo n.º 19
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.signals import config_signal
        from openslides.utils.rest_api import router
        from .signals import setup_assignment_config
        from .views import AssignmentViewSet, AssignmentPollViewSet

        # Connect signals.
        config_signal.connect(setup_assignment_config, dispatch_uid='setup_assignment_config')

        # Register viewsets.
        router.register('assignments/assignment', AssignmentViewSet)
        router.register('assignments/poll', AssignmentPollViewSet)
Exemplo n.º 20
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .views import AssignmentViewSet, AssignmentPollViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Register viewsets.
        router.register(self.get_model('Assignment').get_collection_string(), AssignmentViewSet)
        router.register('assignments/poll', AssignmentPollViewSet)
Exemplo n.º 21
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.signals import permission_change
        from openslides.utils.rest_api import router
        from .signals import get_permission_change_data
        from .views import MediafileViewSet

        # Connect signals.
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='mediafiles_get_permission_change_data')

        # Register viewsets.
        router.register(self.get_model('Mediafile').get_collection_string(), MediafileViewSet)
Exemplo n.º 22
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .views import AssignmentViewSet, AssignmentPollViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Register viewsets.
        router.register(
            self.get_model('Assignment').get_collection_string(),
            AssignmentViewSet)
        router.register('assignments/poll', AssignmentPollViewSet)
Exemplo n.º 23
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.signals import config_signal
        from openslides.utils.rest_api import router
        from .signals import setup_assignment_config
        from .views import AssignmentViewSet, AssignmentPollViewSet

        # Connect signals.
        config_signal.connect(setup_assignment_config,
                              dispatch_uid='setup_assignment_config')

        # Register viewsets.
        router.register(
            self.get_model('Assignment').get_collection_string(),
            AssignmentViewSet)
        router.register('assignments/poll', AssignmentPollViewSet)
Exemplo n.º 24
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from django.db.models import signals
        from openslides.core.config import config
        from openslides.core.signals import post_permission_creation
        from openslides.utils.rest_api import router
        from openslides.utils.search import index_add_instance, index_del_instance
        from .config_variables import get_config_variables
        from .signals import delete_django_app_permissions, create_builtin_projection_defaults
        from .views import (
            ChatMessageViewSet,
            ConfigViewSet,
            ProjectorViewSet,
            TagViewSet,
        )

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_permission_creation.connect(
            delete_django_app_permissions,
            dispatch_uid='delete_django_app_permissions')
        post_permission_creation.connect(
            create_builtin_projection_defaults,
            dispatch_uid='create_builtin_projection_defaults')

        # Register viewsets.
        router.register(
            self.get_model('Projector').get_collection_string(),
            ProjectorViewSet)
        router.register(
            self.get_model('ChatMessage').get_collection_string(),
            ChatMessageViewSet)
        router.register(
            self.get_model('Tag').get_collection_string(), TagViewSet)
        router.register(
            self.get_model('ConfigStore').get_collection_string(),
            ConfigViewSet, 'config')

        # Update the search when a model is saved or deleted
        signals.post_save.connect(index_add_instance,
                                  dispatch_uid='index_add_instance')
        signals.post_delete.connect(index_del_instance,
                                    dispatch_uid='index_del_instance')
        signals.m2m_changed.connect(index_add_instance,
                                    dispatch_uid='m2m_index_add_instance')
Exemplo n.º 25
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.signals import permission_change, user_data_required
        from openslides.utils.rest_api import router
        from .projector import get_projector_elements
        from .signals import get_permission_change_data, required_users
        from .views import MediafileViewSet

        # Define projector elements.
        register_projector_elements(get_projector_elements())

        # Connect signals.
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='mediafiles_get_permission_change_data')
        user_data_required.connect(
            required_users,
            dispatch_uid='mediafiles_required_users')

        # Register viewsets.
        router.register(self.get_model('Mediafile').get_collection_string(), MediafileViewSet)
Exemplo n.º 26
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.config import config
        from openslides.core.signals import post_permission_creation
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import add_permissions_to_builtin_groups
        from .views import ObjectProtocolViewSet, ProtocolViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_permission_creation.connect(
            add_permissions_to_builtin_groups,
            dispatch_uid='protocol_add_permissions_to_builtin_groups'
        )

        # Register viewsets.
        router.register(self.get_model('ObjectProtocol').get_collection_string(), ObjectProtocolViewSet)
        router.register(self.get_model('Protocol').get_collection_string(), ProtocolViewSet)
Exemplo n.º 27
0
    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 openslides.config.signals import config_signal
        from openslides.utils.rest_api import router
        from openslides.projector.api import register_slide_model
        from .signals import create_builtin_workflows, setup_motion_config
        from .views import CategoryViewSet, MotionViewSet, WorkflowViewSet

        # Connect signals.
        config_signal.connect(setup_motion_config,
                              dispatch_uid='setup_motion_config')
        post_migrate.connect(create_builtin_workflows,
                             dispatch_uid='motion_create_builtin_workflows')

        # Register slides.
        Motion = self.get_model('Motion')
        MotionPoll = self.get_model('MotionPoll')
        register_slide_model(Motion, 'motion/slide.html')
        register_slide_model(MotionPoll, 'motion/motionpoll_slide.html')

        # Register viewsets.
        router.register('motion/category', CategoryViewSet)
        router.register('motion/motion', MotionViewSet)
        router.register('motion/workflow', WorkflowViewSet)
Exemplo n.º 28
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.signals import permission_change, user_data_required
        from openslides.utils.rest_api import router
        from .signals import get_permission_change_data, is_user_data_required
        from .views import MediafileViewSet

        # Connect signals.
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='mediafiles_get_permission_change_data')
        user_data_required.connect(
            is_user_data_required,
            dispatch_uid='mediafiles_is_user_data_required')

        # Register viewsets.
        router.register(
            self.get_model('Mediafile').get_collection_string(),
            MediafileViewSet)
Exemplo n.º 29
0
    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('mediafile/mediafile', MediafileViewSet)
Exemplo n.º 30
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from django.db.models import signals
        from openslides.core.config import config
        from openslides.core.signals import post_permission_creation
        from openslides.utils.rest_api import router
        from openslides.utils.search import index_add_instance, index_del_instance
        from .config_variables import get_config_variables
        from .signals import delete_django_app_permissions, create_builtin_projection_defaults
        from .views import (
            ChatMessageViewSet,
            ConfigViewSet,
            ProjectorViewSet,
            TagViewSet,
        )

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_permission_creation.connect(
            delete_django_app_permissions,
            dispatch_uid='delete_django_app_permissions')
        post_permission_creation.connect(
            create_builtin_projection_defaults,
            dispatch_uid='create_builtin_projection_defaults')

        # Register viewsets.
        router.register(self.get_model('Projector').get_collection_string(), ProjectorViewSet)
        router.register(self.get_model('ChatMessage').get_collection_string(), ChatMessageViewSet)
        router.register(self.get_model('Tag').get_collection_string(), TagViewSet)
        router.register(self.get_model('ConfigStore').get_collection_string(), ConfigViewSet, 'config')

        # Update the search when a model is saved or deleted
        signals.post_save.connect(
            index_add_instance,
            dispatch_uid='index_add_instance')
        signals.post_delete.connect(
            index_del_instance,
            dispatch_uid='index_del_instance')
        signals.m2m_changed.connect(
            index_add_instance,
            dispatch_uid='m2m_index_add_instance')
Exemplo n.º 31
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.signals import config_signal
        from openslides.utils.rest_api import router
        from .signals import create_builtin_workflows, setup_motion_config
        from .views import CategoryViewSet, MotionViewSet, MotionPollViewSet, WorkflowViewSet

        # Connect signals.
        config_signal.connect(setup_motion_config, dispatch_uid='setup_motion_config')
        post_migrate.connect(create_builtin_workflows, dispatch_uid='motion_create_builtin_workflows')

        # Register viewsets.
        router.register('motions/category', CategoryViewSet)
        router.register('motions/motion', MotionViewSet)
        router.register('motions/motionpoll', MotionPollViewSet)
        router.register('motions/workflow', WorkflowViewSet)
Exemplo n.º 32
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.signals import config_signal
        from openslides.utils.rest_api import router
        from .signals import create_builtin_workflows, setup_motion_config
        from .views import CategoryViewSet, MotionViewSet, MotionPollViewSet, WorkflowViewSet

        # Connect signals.
        config_signal.connect(setup_motion_config, dispatch_uid='setup_motion_config')
        post_migrate.connect(create_builtin_workflows, dispatch_uid='motion_create_builtin_workflows')

        # Register viewsets.
        router.register(self.get_model('Category').get_collection_string(), CategoryViewSet)
        router.register(self.get_model('Motion').get_collection_string(), MotionViewSet)
        router.register(self.get_model('Workflow').get_collection_string(), WorkflowViewSet)
        router.register('motions/motionpoll', MotionPollViewSet)
Exemplo n.º 33
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import create_builtin_workflows
        from .views import CategoryViewSet, MotionViewSet, MotionPollViewSet, WorkflowViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_migrate.connect(create_builtin_workflows, dispatch_uid='motion_create_builtin_workflows')

        # Register viewsets.
        router.register(self.get_model('Category').get_collection_string(), CategoryViewSet)
        router.register(self.get_model('Motion').get_collection_string(), MotionViewSet)
        router.register(self.get_model('Workflow').get_collection_string(), WorkflowViewSet)
        router.register('motions/motionpoll', MotionPollViewSet)
Exemplo n.º 34
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.signals import permission_change
        from openslides.utils.rest_api import router

        from ..utils.access_permissions import required_user
        from . import serializers  # noqa
        from .projector import register_projector_slides
        from .signals import create_builtin_workflows, get_permission_change_data
        from .views import (
            CategoryViewSet,
            MotionBlockViewSet,
            MotionChangeRecommendationViewSet,
            MotionCommentSectionViewSet,
            MotionOptionViewSet,
            MotionPollViewSet,
            MotionViewSet,
            MotionVoteViewSet,
            StateViewSet,
            StatuteParagraphViewSet,
            WorkflowViewSet,
        )

        # Define projector elements.
        register_projector_slides()

        # Connect signals.
        post_migrate.connect(
            create_builtin_workflows, dispatch_uid="motion_create_builtin_workflows"
        )
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid="motions_get_permission_change_data",
        )

        # Register viewsets.
        router.register(
            self.get_model("Category").get_collection_string(), CategoryViewSet
        )
        router.register(
            self.get_model("StatuteParagraph").get_collection_string(),
            StatuteParagraphViewSet,
        )
        router.register(self.get_model("Motion").get_collection_string(), MotionViewSet)
        router.register(
            self.get_model("MotionBlock").get_collection_string(), MotionBlockViewSet
        )
        router.register(
            self.get_model("MotionCommentSection").get_collection_string(),
            MotionCommentSectionViewSet,
        )
        router.register(
            self.get_model("Workflow").get_collection_string(), WorkflowViewSet
        )
        router.register(
            self.get_model("MotionChangeRecommendation").get_collection_string(),
            MotionChangeRecommendationViewSet,
        )
        router.register(
            self.get_model("MotionPoll").get_collection_string(), MotionPollViewSet
        )
        router.register(
            self.get_model("MotionOption").get_collection_string(), MotionOptionViewSet
        )
        router.register(
            self.get_model("MotionVote").get_collection_string(), MotionVoteViewSet
        )
        router.register(self.get_model("State").get_collection_string(), StateViewSet)

        # Register required_users
        required_user.add_collection_string(
            self.get_model("Motion").get_collection_string(), required_users_motions
        )

        required_user.add_collection_string(
            self.get_model("MotionPoll").get_collection_string(),
            required_users_options,
        )
Exemplo n.º 35
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector  # noqa

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.core.signals import permission_change, user_data_required
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .signals import create_builtin_workflows, get_permission_change_data, is_user_data_required
        from .views import CategoryViewSet, MotionViewSet, MotionBlockViewSet, MotionPollViewSet, MotionChangeRecommendationViewSet, WorkflowViewSet

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_migrate.connect(create_builtin_workflows,
                             dispatch_uid='motion_create_builtin_workflows')
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='motions_get_permission_change_data')
        user_data_required.connect(
            is_user_data_required,
            dispatch_uid='motions_is_user_data_required')

        # Register viewsets.
        router.register(
            self.get_model('Category').get_collection_string(),
            CategoryViewSet)
        router.register(
            self.get_model('Motion').get_collection_string(), MotionViewSet)
        router.register(
            self.get_model('MotionBlock').get_collection_string(),
            MotionBlockViewSet)
        router.register(
            self.get_model('Workflow').get_collection_string(),
            WorkflowViewSet)
        router.register(
            self.get_model(
                'MotionChangeRecommendation').get_collection_string(),
            MotionChangeRecommendationViewSet)
        router.register(
            self.get_model('MotionPoll').get_collection_string(),
            MotionPollViewSet)
Exemplo n.º 36
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.signals import permission_change
        from openslides.utils.rest_api import router
        from .projector import get_projector_elements
        from .signals import (
            create_builtin_workflows,
            get_permission_change_data,
        )
        from .views import (
            CategoryViewSet,
            StatuteParagraphViewSet,
            MotionViewSet,
            MotionCommentSectionViewSet,
            MotionBlockViewSet,
            MotionPollViewSet,
            MotionChangeRecommendationViewSet,
            StateViewSet,
            WorkflowViewSet,
        )
        from ..utils.access_permissions import required_user

        # Define projector elements.
        register_projector_elements(get_projector_elements())

        # Connect signals.
        post_migrate.connect(create_builtin_workflows,
                             dispatch_uid='motion_create_builtin_workflows')
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='motions_get_permission_change_data')

        # Register viewsets.
        router.register(
            self.get_model('Category').get_collection_string(),
            CategoryViewSet)
        router.register(
            self.get_model('StatuteParagraph').get_collection_string(),
            StatuteParagraphViewSet)
        router.register(
            self.get_model('Motion').get_collection_string(), MotionViewSet)
        router.register(
            self.get_model('MotionBlock').get_collection_string(),
            MotionBlockViewSet)
        router.register(
            self.get_model('MotionCommentSection').get_collection_string(),
            MotionCommentSectionViewSet)
        router.register(
            self.get_model('Workflow').get_collection_string(),
            WorkflowViewSet)
        router.register(
            self.get_model(
                'MotionChangeRecommendation').get_collection_string(),
            MotionChangeRecommendationViewSet)
        router.register(
            self.get_model('MotionPoll').get_collection_string(),
            MotionPollViewSet)
        router.register(
            self.get_model('State').get_collection_string(), StateViewSet)

        # Register required_users
        required_user.add_collection_string(
            self.get_model('Motion').get_collection_string(), required_users)
Exemplo n.º 37
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.signals import permission_change
        from openslides.utils.rest_api import router
        from .projector import register_projector_slides
        from .signals import create_builtin_workflows, get_permission_change_data
        from . import serializers  # noqa
        from .views import (
            CategoryViewSet,
            StatuteParagraphViewSet,
            MotionViewSet,
            MotionCommentSectionViewSet,
            MotionBlockViewSet,
            MotionPollViewSet,
            MotionChangeRecommendationViewSet,
            StateViewSet,
            WorkflowViewSet,
        )
        from ..utils.access_permissions import required_user

        # Define projector elements.
        register_projector_slides()

        # Connect signals.
        post_migrate.connect(
            create_builtin_workflows, dispatch_uid="motion_create_builtin_workflows"
        )
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid="motions_get_permission_change_data",
        )

        # Register viewsets.
        router.register(
            self.get_model("Category").get_collection_string(), CategoryViewSet
        )
        router.register(
            self.get_model("StatuteParagraph").get_collection_string(),
            StatuteParagraphViewSet,
        )
        router.register(self.get_model("Motion").get_collection_string(), MotionViewSet)
        router.register(
            self.get_model("MotionBlock").get_collection_string(), MotionBlockViewSet
        )
        router.register(
            self.get_model("MotionCommentSection").get_collection_string(),
            MotionCommentSectionViewSet,
        )
        router.register(
            self.get_model("Workflow").get_collection_string(), WorkflowViewSet
        )
        router.register(
            self.get_model("MotionChangeRecommendation").get_collection_string(),
            MotionChangeRecommendationViewSet,
        )
        router.register(
            self.get_model("MotionPoll").get_collection_string(), MotionPollViewSet
        )
        router.register(self.get_model("State").get_collection_string(), StateViewSet)

        # Register required_users
        required_user.add_collection_string(
            self.get_model("Motion").get_collection_string(), required_users
        )
Exemplo n.º 38
0
    def ready(self):
        # Import all required stuff.
        from openslides.core.config import config
        from openslides.core.signals import permission_change, user_data_required
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .projector import get_projector_elements
        from .signals import (
            create_builtin_workflows,
            get_permission_change_data,
            required_users,
        )
        from .views import (
            CategoryViewSet,
            MotionViewSet,
            MotionBlockViewSet,
            MotionPollViewSet,
            MotionChangeRecommendationViewSet,
            StateViewSet,
            WorkflowViewSet,
        )

        # Define config variables and projector elements.
        config.update_config_variables(get_config_variables())
        register_projector_elements(get_projector_elements())

        # Connect signals.
        post_migrate.connect(
            create_builtin_workflows,
            dispatch_uid='motion_create_builtin_workflows')
        permission_change.connect(
            get_permission_change_data,
            dispatch_uid='motions_get_permission_change_data')
        user_data_required.connect(
            required_users,
            dispatch_uid='motions_required_users')

        # Register viewsets.
        router.register(self.get_model('Category').get_collection_string(), CategoryViewSet)
        router.register(self.get_model('Motion').get_collection_string(), MotionViewSet)
        router.register(self.get_model('MotionBlock').get_collection_string(), MotionBlockViewSet)
        router.register(self.get_model('Workflow').get_collection_string(), WorkflowViewSet)
        router.register(self.get_model('MotionChangeRecommendation').get_collection_string(),
                        MotionChangeRecommendationViewSet)
        router.register(self.get_model('MotionPoll').get_collection_string(), MotionPollViewSet)
        router.register(self.get_model('State').get_collection_string(), StateViewSet)
Exemplo n.º 39
0
    def ready(self):
        # Load projector elements.
        # Do this by just importing all from these files.
        from . import projector

        # Import all required stuff.
        from openslides.core.config import config
        from openslides.core.signals import post_permission_creation
        from openslides.users.models import Group, User
        from openslides.utils.rest_api import router
        from .config_variables import get_config_variables
        from .projector import get_projector_elements
        from .signals import (
            add_permissions_to_builtin_groups,
            update_authorized_voters,
            inform_keypad_deleted,
        )
        from .urls import urlpatterns
        from .models import Keypad, VotingShare
        from .views import (
            AssignmentAbsenteeVoteViewSet,
            AssignmentPollBallotViewSet,
            AssignmentPollTypeViewSet,
            AttendanceLogViewSet,
            AuthorizedVotersViewSet,
            KeypadViewSet,
            MotionAbsenteeVoteViewSet,
            MotionPollBallotViewSet,
            MotionPollTypeViewSet,
            VotingControllerViewSet,
            VotingPrincipleViewSet,
            VotingProxyViewSet,
            VotingShareViewSet,
            VotingTokenViewSet
        )

        # Register projector elements
        register_projector_elements(get_projector_elements())

        # Define config variables
        config.update_config_variables(get_config_variables())

        # Connect signals.
        post_permission_creation.connect(
            add_permissions_to_builtin_groups,
            dispatch_uid='voting_add_permissions_to_builtin_groups'
        )

        post_delete.connect(inform_keypad_deleted, sender=Keypad)

        # Register viewsets.
        router.register(self.get_model('AssignmentAbsenteeVote').get_collection_string(), AssignmentAbsenteeVoteViewSet)
        router.register(self.get_model('AssignmentPollBallot').get_collection_string(), AssignmentPollBallotViewSet)
        router.register(self.get_model('AssignmentPollType').get_collection_string(), AssignmentPollTypeViewSet)
        router.register(self.get_model('AttendanceLog').get_collection_string(), AttendanceLogViewSet)
        router.register(self.get_model('AuthorizedVoters').get_collection_string(), AuthorizedVotersViewSet)
        router.register(self.get_model('Keypad').get_collection_string(), KeypadViewSet)
        router.register(self.get_model('MotionAbsenteeVote').get_collection_string(), MotionAbsenteeVoteViewSet)
        router.register(self.get_model('MotionPollBallot').get_collection_string(), MotionPollBallotViewSet)
        router.register(self.get_model('MotionPollType').get_collection_string(), MotionPollTypeViewSet)
        router.register(self.get_model('VotingToken').get_collection_string(), VotingTokenViewSet)
        router.register(self.get_model('VotingController').get_collection_string(), VotingControllerViewSet)
        router.register(self.get_model('VotingPrinciple').get_collection_string(), VotingPrincipleViewSet)
        router.register(self.get_model('VotingShare').get_collection_string(), VotingShareViewSet)
        router.register(self.get_model('VotingProxy').get_collection_string(), VotingProxyViewSet)

        # Provide plugin urlpatterns to application configuration.
        self.urlpatterns = urlpatterns