Exemplo n.º 1
0
class SampleCases(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    s_description = db.Column(db.String(64))
    s_type = db.Column(db.String(32))
    s_modelClsId = db.Column(db.Integer, db.ForeignKey(Cnns.id))
    s_modelDetId = db.Column(db.Integer, db.ForeignKey(Cnns.id))
    s_dataId = db.Column(db.Integer, db.ForeignKey(DataSets.id))
Exemplo n.º 2
0
class Orders(db.Model, BaseModel):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    money = db.Column(db.Integer, nullable=False)
    paytime = db.Column(db.DateTime, default=datetime.now)
    uid = db.Column(db.Integer, db.ForeignKey('bbs_user.uid'))
    tid = db.Column(db.Integer, db.ForeignKey('bbs_posts.id'))
    __tablename__ = 'bbs_order'
Exemplo n.º 3
0
class ApiCases(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    a_description = db.Column(db.String(64))
    a_level = db.Column(db.String(16))
    a_type = db.Column(db.String(32))
    a_modelId = db.Column(db.Integer, db.ForeignKey(Cnns.id))
    a_dataId = db.Column(db.Integer, db.ForeignKey(DataSets.id))
class HallMovie(BaseModel):

    h_movie_id = db.Column(db.Integer, db.ForeignKey(Movie.id))

    h_hall_id = db.Column(db.Integer, db.ForeignKey(Hall.id))

    h_time = db.Column(db.DateTime)
Exemplo n.º 5
0
class Video(db.Model):
    __tablename__ = 'video'
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(255), unique=True)
    url = db.Column(db.String(255), unique=True)  # 地址
    info = db.Column(db.Text)  # 简介
    logo = db.Column(db.String(255), unique=True)  # 封面
    star = db.Column(db.SmallInteger)  # 星级评分
    playnum = db.Column(db.BigInteger)  # 播放量
    commentnum = db.Column(db.BigInteger)  # 评论量
    col_num = db.Column(db.Integer, default=0)  #收藏量
    up_num = db.Column(db.Integer, default=0)
    tag_id = db.Column(db.Integer, db.ForeignKey('tag.id'))  # 所属标签
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))  # 所属用户
    comments = db.relationship('Comment', backref='video')  # 评论
    video_cols = db.relationship('Videocol', backref='video')  # 收藏
    video_ups = db.relationship('Videoup', backref='video')  #点赞
    release_time = db.Column(db.Date)  # 上映时间
    area = db.Column(db.String(255))  # 上映地区
    length = db.Column(db.String(100))  # 播放时长
    addtime = db.Column(db.DateTime, index=True,
                        default=datetime.now())  # 添加时间

    def __repr__(self):
        return "<Video %r>" % self.title
Exemplo n.º 6
0
class Flight(BaseModel):
    __tablename__ = 'cinema_flight'
    f_movie_id = db.Column(db.Integer, db.ForeignKey(Movie.id))
    f_hall_id = db.Column(db.Integer, db.ForeignKey(Hall.id))
    f_time = db.Column(db.DateTime)
    f_price = db.Column(db.Float, default=40.0)

    movieorder = db.relationship('MovieOrder', backref='Flight', lazy=True)
Exemplo n.º 7
0
class Order(BaseModel, db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)

    o_user = db.Column(db.Integer, db.ForeignKey(User.id))

    o_movie_plan = db.Column(db.String(128), db.ForeignKey(MoviePlan.id))
    # 1:已下单,未付款 2:已下单,已付款 3.....
    o_status = db.Column(db.Integer, default=1)
Exemplo n.º 8
0
class MovieOrder(BaseModel):
    __tablename__ = 'movie_order'
    o_user_id = db.Column(db.Integer, db.ForeignKey(MovieUser.id))
    o_flight_id = db.Column(db.Integer, db.ForeignKey(Flight.id))
    o_status = db.Column(db.Integer, default=ORDER_STATUS_NOT_PAY)
    o_time = db.Column(db.DateTime)
    o_seat = db.Column(db.String(128))
    o_price = db.Column(db.Float)
Exemplo n.º 9
0
class SeatOrder(BaseModel):

    s_user = db.Column(db.Integer, db.ForeignKey(ViewerUser.id))
    s_paidang = db.Column(db.Integer, db.ForeignKey(PaiDang.id))
    s_price = db.Column(db.Float, default=1)
    s_seats = db.Column(db.String(128))
    s_status = db.Column(db.Integer, default=SEAT_ORDER_STATUS_NOT_PAY)
    s_expire = db.Column(db.DateTime)
Exemplo n.º 10
0
class MovieOrder(BaseModel):
    # o_user_id = db.Column(db.Integer, db.ForeignKey(MovieUser.id))
    o_user_id = db.Column(db.Integer, db.ForeignKey("movie_user.id"))
    o_hall_movie_id = db.Column(db.Integer, db.ForeignKey("hall_movie.id"))
    o_time = db.Column(db.DateTime)
    o_status = db.Column(db.Integer, default=ORDER_STATUS_NOT_PAY)
    o_seats = db.Column(db.String(128))
    o_price = db.Column(db.Float, default=0)
Exemplo n.º 11
0
class Videoup(db.Model):
    __tablename__ = "videoup"
    id = db.Column(db.Integer, primary_key=True)
    video_id = db.Column(db.Integer, db.ForeignKey('video.id'))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    addtime = db.Column(db.DateTime, index=True, default=datetime.now())

    def __repr__(self):
        return "<Videocol %r>" % self.id
Exemplo n.º 12
0
class Tasks(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    t_description = db.Column(db.String(64))
    t_caseType = db.Column(db.String(16))
    t_hostId = db.Column(db.Integer, db.ForeignKey(Hosts.id))
    t_apiCaseId = db.Column(db.Integer, db.ForeignKey(ApiCases.id))
    t_sampleCaseId = db.Column(db.Integer, db.ForeignKey(SampleCases.id))
    t_duration = db.Column(db.Integer, default=1)
    t_status = db.Column(db.String(16))
Exemplo n.º 13
0
class ModelResponse(db.Model):
    response_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    user_id = db.Column(db.Integer)
    trial_number = db.Column(db.Integer)
    recorded_response = db.Column(db.Integer,
                                  db.ForeignKey('answer.answer_id'))
    expected_response = db.Column(db.Integer,
                                  db.ForeignKey('answer.answer_id'))
    correct = db.Column(db.Boolean)
Exemplo n.º 14
0
class MoviePlan(db.Model):

    id = db.Column(db.String(128), primary_key=True)

    mp_movie = db.Column(db.Integer, db.ForeignKey(Movie.id))

    mp_hall = db.Column(db.Integer, db.ForeignKey(Hall.id))

    mp_time = db.Column(db.DateTime)
class HallMovie(BaseModel):

    h_movie_id = db.Column(db.Integer, db.ForeignKey(Movie.id))

    h_hall_id = db.Column(db.Integer, db.ForeignKey(Hall.id))

    h_time = db.Column(db.DateTime)

    h_orders = db.relationship('MovieOrder', backref='HallMovie', lazy=True)
Exemplo n.º 16
0
class Comment(db.Model):
    __tablename__ = "comment"
    id = db.Column(db.Integer, primary_key=True)
    content = db.Column(db.Text)
    video_id = db.Column(db.Integer, db.ForeignKey('video.id'))
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    addtime = db.Column(db.DateTime, index=True, default=datetime.now())

    def __repr__(self):
        return "<Comment %r>" % self.id
Exemplo n.º 17
0
class Cart(db.Model):

    __tablename__ = 'axf_cart'

    id = db.Column(db.INTEGER, primary_key=True, autoincrement=True)
    c_user = db.Column(db.INTEGER, db.ForeignKey(AXFUser.id))
    c_goods = db.Column(db.INTEGER, db.ForeignKey(Goods.id))

    c_goods_num = db.Column(db.INTEGER, default=1)
    c_is_select = db.Column(db.Boolean, default=True)
Exemplo n.º 18
0
class Message(BaseModel):
    body = db.Column(db.Text, nullable=False)
    timestamp = db.Column(db.DateTime, default=datetime.now(), index=True)

    message_author = db.Column(db.Integer,
                               db.ForeignKey('user.id'),
                               nullable=False)
    message_room = db.Column(db.Integer,
                             db.ForeignKey('room.id'),
                             nullable=False)
Exemplo n.º 19
0
class Reply(db.Model, BaseModel):
    rid = db.Column(db.Integer, primary_key=True, autoincrement=True)
    content = db.Column(db.String(1000))
    istop = db.Column(db.Integer, default=0)  # 置顶
    isdel = db.Column(db.SmallInteger, default=0)  # 删除 0表示未删除,1表示删除
    isblock = db.Column(db.SmallInteger, default=0)
    createtime = db.Column(db.DateTime, default=datetime.now)
    uid = db.Column(db.Integer, db.ForeignKey('bbs_user.uid'))
    tid = db.Column(db.Integer,
                    db.ForeignKey('bbs_posts.id', ondelete='CASCADE'))
    __tablename__ = 'bbs_reply'
Exemplo n.º 20
0
class CommentLike(BaseModel, db.Model):
    """评论点赞"""
    __tablename__ = "info_comment_like"
    comment_id = db.Column("comment_id",
                           db.Integer,
                           db.ForeignKey("info_comment.id"),
                           primary_key=True)  # 评论编号
    user_id = db.Column("user_id",
                        db.Integer,
                        db.ForeignKey("info_user.id"),
                        primary_key=True)  # 用户编号
Exemplo n.º 21
0
class ItemInfo(BaseModel):
    id = db.Column(db.String(64), primary_key=True)
    info = db.Column(db.String(16))
    type = db.Column(db.String(16),
                     db.ForeignKey(ItemType.type, ondelete="SET DEFAULT"),
                     default="其它")
    image = db.Column(db.String(128))
    desc = db.Column(db.String(1024))
    date = db.Column(db.DateTime)
    place = db.Column(db.String(64))
    campus = db.Column(db.String(32))
    uid = db.Column(db.String(16), db.ForeignKey(User.id))
    claim_date = db.Column(db.DateTime)
    is_claim = db.Column(db.Boolean, default=False)
    is_delete = db.Column(db.Boolean, default=False)
Exemplo n.º 22
0
class Appointment(db.Model):
    # 给表重新定义一个名称,默认名称是类名的小写,appointment借阅记录。
    __tablename__ = "appointment"
    appointmentID = db.Column(db.Integer,
                              primary_key=True,
                              nullable=False,
                              autoincrement=True)
    userID = db.Column(db.String(7),
                       db.ForeignKey('client.userID'),
                       nullable=False)
    bookID = db.Column(db.String(7),
                       db.ForeignKey('book.bookID'),
                       nullable=False)
    bookNum = db.Column(db.Integer, nullable=True)
    DataTime = db.Column(db.DateTime, default=datetime.datetime.now)
Exemplo n.º 23
0
class Ticket(BaseModel, db.Model):

    id = db.Column(db.Integer, primary_key=True, autoincrement=True)

    t_order = db.Column(db.Integer, db.ForeignKey(Order.id))

    t_seat = db.Column(db.Integer)
Exemplo n.º 24
0
class City(BaseModel):
    letter_id = db.Column(db.Integer, db.ForeignKey(Letter.id))
    c_id = db.Column(db.Integer, default=0)
    c_parent_id = db.Column(db.Integer, default=0)
    c_region_name = db.Column(db.String(16))
    c_city_code = db.Column(db.Integer, default=0)
    c_pinyin = db.Column(db.String(64))
Exemplo n.º 25
0
class City(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    regionName = db.Column(db.String(16))
    cityCode = db.Column(db.Integer)
    pinYin = db.Column(db.String(128))
    #外键设置的语法  是 ForeignKey(类名.主键名字)
    letter = db.Column(db.Integer, db.ForeignKey(Letter.id))
Exemplo n.º 26
0
class Comment(BaseModel, db.Model):
    """评论"""
    __tablename__ = "info_comment"

    id = db.Column(db.Integer, primary_key=True)  # 评论编号
    user_id = db.Column(db.Integer,
                        db.ForeignKey("info_user.id"),
                        nullable=False)  # 用户id
    news_id = db.Column(db.Integer,
                        db.ForeignKey("info_blog.id"),
                        nullable=False)  # blog的id
    content = db.Column(db.Text, nullable=False)  # 评论内容
    parent_id = db.Column(db.Integer,
                          db.ForeignKey("info_comment.id"))  # 父评论id
    parent = db.relationship("Comment", remote_side=[id])  # 自关联
    like_count = db.Column(db.Integer, default=0)  # 点赞条数
Exemplo n.º 27
0
class Blog(BaseModel, db.Model):
    """博客"""
    __tablename__ = "info_blog"
    id = db.Column(db.Integer, primary_key=True)  # 用户编号
    title = db.Column(db.String(256), nullable=False)  # 标题
    source = db.Column(db.String(64), nullable=False)  # 来源
    digest = db.Column(db.String(512), nullable=False)  # 摘要
    index_image_url = db.Column(db.String(256))  # 博客列表图片路径
    category_id = db.Column(db.Integer, db.ForeignKey("info_category.id"))
    user_id = db.Column(db.Integer,
                        db.ForeignKey("info_user.id"))  # 当前blog的作者id
    status = db.Column(db.Integer,
                       default=0)  # 当前blog状态 如果为0代表审核通过,1代表审核中,-1代表审核不通过
    reason = db.Column(db.String(256))  # 未通过原因,status = -1 的时候使用
    # 当前新闻的所有评论
    comments = db.relationship("Comment", lazy="dynamic")
Exemplo n.º 28
0
class Post(db.Model):
    __tablename__ = "user_post"
    id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
    title = db.Column(db.String(100))
    text = db.Column(db.Text())
    publish_date = db.Column(db.DateTime())
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'))
Exemplo n.º 29
0
class City(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    parentId = db.Column(db.Integer, default=0)
    regionName = db.Column(db.String(100))
    cityCode = db.Column(db.Integer)
    pinYin = db.Column(db.String(40))
    c_letter = db.Column(db.Integer, db.ForeignKey(Letter.id))
Exemplo n.º 30
0
class User(ModelBase, db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    u_name = db.Column(db.String(16), unique=True)
    u_age = db.Column(db.Integer)
    a_id = db.Column(db.Integer, db.ForeignKey('address.id'))
    address = db.relationship('Address',
                              backref=db.backref('user', lazy='dynamic'))