@author: Ioan v. Pocol Contains the SQL alchemy meta for media video data API. ''' from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.types import Integer, String from sqlalchemy.ext.declarative import declared_attr from superdesk.meta.metadata_superdesk import Base from ally.internationalization import N_ from superdesk.media_archive.meta.meta_data import MetaDataMapped from superdesk.media_archive.api.video_data import VideoData # -------------------------------------------------------------------- META_TYPE_KEY = N_('video') # The key used for video meta data # -------------------------------------------------------------------- class VideoDataDefinition: ''' Provides the mapping for VideoData definition. ''' __tablename__ = 'archive_video_data' __table_args__ = dict(mysql_engine='InnoDB', mysql_charset='utf8') Id = declared_attr(lambda cls: Column('fk_metadata_id', ForeignKey(MetaDataMapped.Id), primary_key=True)) Length = declared_attr(lambda cls: Column('length', Integer)) VideoEncoding = declared_attr(lambda cls: Column('video_encoding', String(255))) Width = declared_attr(lambda cls: Column('width', Integer))
@author: Ioan v. Pocol Contains the SQL alchemy meta for media audio data API. ''' from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.types import Integer, String from sqlalchemy.ext.declarative import declared_attr from superdesk.meta.metadata_superdesk import Base from ally.internationalization import N_ from superdesk.media_archive.meta.meta_data import MetaDataMapped from superdesk.media_archive.api.audio_data import AudioData # -------------------------------------------------------------------- META_TYPE_KEY = N_('audio') # The key used for audio meta data # -------------------------------------------------------------------- class AudioDataDefinition: ''' Provides the mapping for AudioData definition. ''' __tablename__ = 'archive_audio_data' __table_args__ = dict(mysql_engine='InnoDB', mysql_charset='utf8') Id = declared_attr( lambda cls: Column('fk_metadata_id', ForeignKey(MetaDataMapped.Id, ondelete='CASCADE'),
@author: Gabriel Nistor API specifications for localized messages sources. ''' from .file import File, QFile from admin.api.domain_admin import modelAdmin from ally.api.config import service, query from ally.api.criteria import AsEqual from ally.internationalization import N_ from ally.support.api.entity import Entity, QEntity, IEntityService # -------------------------------------------------------------------- # The python type for the source TYPE_PYTHON = N_('python') # The java script type for the source TYPE_JAVA_SCRIPT = N_('javascript') TYPES = (TYPE_PYTHON, TYPE_JAVA_SCRIPT) # The available source types. # -------------------------------------------------------------------- @modelAdmin class Source(File): ''' Model for the source of the message, basically a file reference. ''' Type = str
''' from ..api.meta_data import MetaData from .meta_type import MetaTypeMapped from sqlalchemy.dialects.mysql.base import INTEGER from sqlalchemy.orm.mapper import reconstructor from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.types import String, DateTime, Integer from superdesk.meta.metadata_superdesk import Base from ally.support.sqlalchemy.session import openSession from superdesk.user.meta.user import UserMapped from ally.internationalization import N_ # -------------------------------------------------------------------- META_TYPE_KEY = N_('other') # The key used for simple meta data objects # -------------------------------------------------------------------- class ThumbnailFormat(Base): ''' Provides the mapping for thumbnails. This is not a REST model. ''' __tablename__ = 'archive_thumbnail' __table_args__ = dict(mysql_engine='InnoDB') id = Column('id', INTEGER(unsigned=True), primary_key=True) format = Column('format',
@author: Gabriel Nistor Contains the SQL alchemy meta for media image data API. ''' from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.types import Integer, String, DateTime from sqlalchemy.ext.declarative import declared_attr from superdesk.meta.metadata_superdesk import Base from ally.internationalization import N_ from superdesk.media_archive.meta.meta_data import MetaDataMapped from superdesk.media_archive.api.image_data import ImageData # -------------------------------------------------------------------- META_TYPE_KEY = N_('image') # The key used for image meta data # -------------------------------------------------------------------- class ImageDataDefinition: ''' Provides the mapping for ImageData definition. ''' __tablename__ = 'archive_image_data' __table_args__ = dict(mysql_engine='InnoDB', mysql_charset='utf8') Id = declared_attr(lambda cls: Column('fk_metadata_id', ForeignKey(MetaDataMapped.Id, ondelete='CASCADE'), primary_key=True)) Width = declared_attr(lambda cls: Column('width', Integer)) Height = declared_attr(lambda cls: Column('height', Integer)) CreationDate = declared_attr(lambda cls: Column('creation_date', DateTime))