from mediagoblin.db.sql.base import Base
from sqlalchemy import (
- Column, Integer, Unicode, UnicodeText, DateTime, Boolean, ForeignKey,
- UniqueConstraint)
+ Column, Integer, ForeignKey)
+from sqlalchemy.orm import relationship, backref
class AsciiData(Base):
# The primary key *and* reference to the main media_entry
media_entry = Column(Integer, ForeignKey('core__media_entries.id'),
primary_key=True)
+ get_media_entry = relationship("MediaEntry",
+ backref=backref("ascii__media_data", cascade="all, delete-orphan"))
DATA_MODEL = AsciiData
from sqlalchemy import (
Column, Integer, Float, ForeignKey)
+from sqlalchemy.orm import relationship, backref
from mediagoblin.db.sql.extratypes import JSONEncoded
# The primary key *and* reference to the main media_entry
media_entry = Column(Integer, ForeignKey('core__media_entries.id'),
primary_key=True)
+ get_media_entry = relationship("MediaEntry",
+ backref=backref("image__media_data", cascade="all, delete-orphan"))
+
width = Column(Integer)
height = Column(Integer)
exif_all = Column(JSONEncoded)
from sqlalchemy import (
Column, Integer, SmallInteger, ForeignKey)
+from sqlalchemy.orm import relationship, backref
class VideoData(Base):
# The primary key *and* reference to the main media_entry
media_entry = Column(Integer, ForeignKey('core__media_entries.id'),
primary_key=True)
+ get_media_entry = relationship("MediaEntry",
+ backref=backref("video__media_data", cascade="all, delete-orphan"))
+
width = Column(SmallInteger)
height = Column(SmallInteger)