OpenSlides/openslides/mediafiles/projector.py

22 lines
574 B
Python
Raw Normal View History

from typing import Generator, Type
from ..core.exceptions import ProjectorException
from ..utils.projector import ProjectorElement
from .models import Mediafile
class MediafileSlide(ProjectorElement):
"""
Slide definitions for Mediafile model.
"""
2019-01-06 16:22:33 +01:00
name = "mediafiles/mediafile"
def check_data(self):
2019-01-06 16:22:33 +01:00
if not Mediafile.objects.filter(pk=self.config_entry.get("id")).exists():
raise ProjectorException("File does not exist.")
def get_projector_elements() -> Generator[Type[ProjectorElement], None, None]:
yield MediafileSlide