Exemplo n.º 1
0
class UserModel(UserMixin, flask_login.UserMixin, db.Model):
    __tablename__ = 'users'

    posts = db.relationship('PostModel', backref='user')
    comments = db.relationship('CommentModel', backref='user')

    test_model = TestUserModel
Exemplo n.º 2
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')
Exemplo n.º 3
0
class MovieModel(MovieMixin, db.Model):
    __tablename__ = 'movies'
    __table_args__ = {'extend_existing': True}

    test_model = TestMovieModel

    showtimes = db.relationship('ShowtimeModel')
Exemplo n.º 4
0
class TheaterModel(TheaterMixin, db.Model):
    __tablename__ = 'theaters'
    __table_args__ = {'extend_existing': True}

    test_model = TestTheaterModel

    theater_tickets = db.relationship('TheaterTicketModel')
Exemplo n.º 5
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')
Exemplo n.º 6
0
class MovieModel(MovieMixin, db.Model):
    __tablename__ = 'movies'

    test_model = TestMovieModel

    showtimes = db.relationship('ShowtimeModel',
                                backref='movie',
                                order_by='ShowtimeModel.start_time')
Exemplo n.º 7
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')
Exemplo 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