Esempio n. 1
0
class ViewModel(ViewMixin, db.Model):
    __tablename__ = 'views'

    user_id = db.Column(db.Integer(), db.ForeignKey('users.id'))
    post_id = db.Column(db.Integer(), db.ForeignKey('posts.id'))

    test_model = TestViewModel
Esempio n. 2
0
class TheaterTicketModel(TheaterTicketMixin, db.Model):
    __tablename__ = 'theater_tickets'

    test_model = TestTheaterTicketModel

    showtime_id = db.Column(db.Integer(), db.ForeignKey('showtimes.id'))
    theater_id = db.Column(db.Integer(), db.ForeignKey('theaters.id'))
Esempio n. 3
0
class TestShowtimeModel(ShowtimeMixin, db.Model):
    __tablename__ = 'test_showtimes'

    cinema_id = db.Column(db.Integer, db.ForeignKey('test_cinemas.id'))
    movie_id = db.Column(db.Integer, db.ForeignKey('test_movies.id'))
    theater_id = db.Column(db.Integer, db.ForeignKey('test_theaters.id'))

    theater = db.relationship('TestTheaterModel', backref='showtimes')
Esempio n. 4
0
class TestShowtimeModel(ShowtimeMixin, db.Model):
    __tablename__ = 'test_showtimes'
    __table_args__ = {'extend_existing': True}

    movie_id = db.Column(db.Integer, db.ForeignKey('test_movies.id'))
    theater_id = db.Column(db.Integer, db.ForeignKey('test_theaters.id'))

    theater = db.relationship('TestTheaterModel')
Esempio n. 5
0
class CommentModel(CommentMixin, db.Model):
    __tablename__ = 'comments'

    user_id = db.Column(db.Integer(), db.ForeignKey('users.id'))
    post_id = db.Column(db.Integer(), db.ForeignKey('posts.id'))
    parent_id = db.Column(db.Integer(), nullable=True)

    test_model = TestCommentModel
Esempio n. 6
0
class TestTheaterModel(TheaterMixin, db.Model):
    __tablename__ = 'test_theaters'

    cinema_id = db.Column(db.Integer(), db.ForeignKey('test_cinemas.id'))

    theater_tickets = db.relationship('TestTheaterTicketModel',
                                      backref='theater')
Esempio n. 7
0
class TheaterTicketModel(TheaterTicketMixin, db.Model):
    __tablename__ = 'theater_tickets'
    __table_args__ = {'extend_existing': True}

    test_model = TestTheaterTicketModel

    theater_id = db.Column(db.Integer(), db.ForeignKey('theaters.id'))
Esempio n. 8
0
class PostModel(PostMixin, db.Model):
    __tablename__ = 'posts'

    user_id = db.Column(db.Integer(), db.ForeignKey('users.id'))

    tags = db.relationship('TagModel', backref='post')

    test_model = TestPostModel
Esempio n. 9
0
class TagModel(TagMixin, db.Model):
    __tablename__ = 'tags'

    post_id = db.Column(db.Integer(), db.ForeignKey('posts.id'))

    test_model = TestTagModel