代码拉取完成,页面将自动刷新
from exts import db
class ProductModel(db.Model):
"""商品类"""
__tablename__ = "product"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
product_id = db.Column(db.Integer, nullable=False)
product_name = db.Column(db.String(length=255), nullable=False)
product_category_id = db.Column(db.String(length=255), nullable=False)
amazon_id = db.Column(db.String(length=255), nullable=False)
product_image = db.Column(db.String(length=255), nullable=False)
product_category = db.Column(db.String(length=255), nullable=False)
product_ugc_tag = db.Column(db.String(length=255), nullable=False)
class RatingsModel(db.Model):
"""评分类"""
__tablename__ = "ratings"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
user_id = db.Column(db.Integer, nullable=False)
product_id = db.Column(db.Integer, nullable=False)
rating = db.Column(db.Float, nullable=False)
rating_time = db.Column(db.DateTime, nullable=False)
class UserModel(db.Model):
"""用户类"""
__tablename__ = "user"
id = db.Column(db.BigInteger, primary_key=True, autoincrement=True)
user_id = db.Column(db.String(length=255), nullable=False)
account = db.Column(db.String(length=255), nullable=False)
password = db.Column(db.String(length=255), nullable=False)
email = db.Column(db.String(length=255), nullable=False)
class HistoricalTopProductsModel(db.Model):
"""历史热门类"""
__tablename__ = "historical_top_products"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
product_id = db.Column(db.Integer, nullable=False)
class RecentlyTopProductsModel(db.Model):
"""近期热门类"""
__tablename__ = "recently_top_products"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
product_id = db.Column(db.Integer, nullable=False)
product_count = db.Column(db.Integer, nullable=False)
year_month = db.Column(db.String(length=255), nullable=False)
class AverageProducts(db.Model):
"""商品平均评分类"""
__tablename__ = "average_products"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
product_id = db.Column(db.Integer, nullable=False)
product_rating = db.Column(db.Float, nullable=False)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。