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
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'))
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')
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')
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
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')
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'))
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
class TagModel(TagMixin, db.Model): __tablename__ = 'tags' post_id = db.Column(db.Integer(), db.ForeignKey('posts.id')) test_model = TestTagModel