コード例 #1
0
class Media_File(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    title = db.Column(db.String(250))
    slug = db.Column(db.String(250))
    path = db.Column(db.String(250))
    image_path = db.Column(db.String(250))
    overview = db.Column(db.TEXT())
    media_type = db.Column(db.String(250))

    __mapper_args__ = {'polymorphic_on': media_type}
コード例 #2
0
class SeasonSchema(Schema):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    not_blank = validate.Length(min=1, error='Field cannot be blank')
    number = fields.Integer(validate=not_blank)
    overview = db.Column(db.TEXT())
    # Need to make this field
    #not blank on add
    art = fields.String()

    class Meta:
        fields = ('id', 'number', 'overview', 'art')
コード例 #3
0
class Season(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    number = db.Column(db.Integer)
    overview = db.Column(db.TEXT())
    art = db.Column(db.String())
    series = db.Column(db.Integer, db.ForeignKey(Series.id))

    def __init__(self, number, overview, art, series):
        self.number = number
        self.overview = overview
        self.art = art
        self.series = series
コード例 #4
0
class MovieSchema(Schema):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    not_blank = validate.Length(min=1, error='Field cannot be blank')
    title = fields.String(validate=not_blank)
    path = fields.String(validate=not_blank)
    overview = db.Column(db.TEXT())
    episode_number = fields.Integer()
    # Need to make this field
    #not blank on add
    image_path = fields.String()

    class Meta:
        fields = ('id', 'title', 'path', 'overview', 'episode_number',
                  'image_path')