6abb0976c2
* Second websocket channel for the projector * Removed use of projector requirements for REST API requests. Refactored data serializing for projector websocket connection. * Refactor the way that the projector autoupdate get its data. * Fixed missing assignment slide title for hidden items. * Release all items for item list slide and list of speakers slide. Fixed error with motion workflow. * Created CollectionElement class which helps to handle autoupdate.
28 lines
859 B
Python
28 lines
859 B
Python
from ..core.exceptions import ProjectorException
|
|
from ..utils.projector import ProjectorElement
|
|
from .models import Motion
|
|
|
|
|
|
class MotionSlide(ProjectorElement):
|
|
"""
|
|
Slide definitions for Motion model.
|
|
"""
|
|
name = 'motions/motion'
|
|
|
|
def check_data(self):
|
|
if not Motion.objects.filter(pk=self.config_entry.get('id')).exists():
|
|
raise ProjectorException('Motion does not exist.')
|
|
|
|
def get_requirements(self, config_entry):
|
|
try:
|
|
motion = Motion.objects.get(pk=config_entry.get('id'))
|
|
except Motion.DoesNotExist:
|
|
# Motion does not exist. Just do nothing.
|
|
pass
|
|
else:
|
|
yield motion
|
|
yield motion.agenda_item
|
|
yield motion.state.workflow
|
|
yield from motion.submitters.all()
|
|
yield from motion.supporters.all()
|