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

    test_model = TestMovieModel

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

    test_model = TestTheaterModel

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

    test_model = TestMovieModel

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