コード例 #1
0
class WishlistModel(db.Model):
    __tablename__ = 'Mywhislist'
    id = db.Column(db.Integer, primary_key=True)
    product_id = db.Column(db.Integer,
                           db.ForeignKey('product.id'),
                           nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
コード例 #2
0
class CartModel(db.Model):
    __tablename__ = 'cart'
    id = db.Column(db.Integer, primary_key=True)
    quantity = db.Column(db.Integer, nullable=False)
    total_cost = db.Column(db.Integer, nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    product_id = db.column(db.Integer, db.ForeignKey('product.id'))
コード例 #3
0
class CommentDetail(db.Model):
    __tablename__ = 'comment_user'
    id = db.Column(db.Integer,primary_key=True)
    product_id = db.Column(db.Integer,db.ForeignKey('product.id'),nullable=False)
    comment_id = db.Column(db.Integer, db.ForeignKey('comments.id'), unique=True, nullable=False)
    upvote = db.Column(db.Integer,nullable=True)
    downvote=db.Column(db.Integer,nullable=True)
コード例 #4
0
class Orders(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
    paid = db.Column(db.Boolean, nullable=False)
    payment_id = db.Column(db.Integer,
                           db.ForeignKey('payment.id'),
                           unique=True,
                           nullable=False)
コード例 #5
0
class OrderDetail(db.Model):
    _tablename__ = 'order_detail'
    id = db.Column(db.Integer, primary_key=True)
    order_id = db.Column(db.Integer, db.ForeignKey('orders.id'))
    product_id = db.Column(db.Integer, db.ForeignKey('product.id'))
    quantity = db.Column(db.Integer, nullable=False)
    amount = db.Column(db.Integer, nullable=False)
    ship_address = db.Column(db.String(100), nullable=False)
コード例 #6
0
class Comments(db.Model):
    __tablename__='comments'
    id = db.Column(db.Integer, primary_key=True)
    comment=db.Column(db.String(255),nullable=False)
    upvote = db.Column(db.Integer,nullable=True)
    downvote=db.Column(db.Integer,nullable=True)
    user_id = db.Column(db.Integer,db.ForeignKey('user.id'))
    product_id=db.Column(db.Integer,db.ForeignKey('product.id'))
コード例 #7
0
class CartDetail(db.Model):
    __tablename__ = 'cart_detail'
    id = db.Column(db.Integer, primary_key=True)
    cart_id = db.Column(db.Integer, db.ForeignKey('cart.id'), nullable=False)
    product_id = db.Column(db.Integer,
                           db.ForeignKey('product.id'),
                           nullable=False)
    quantity = db.Column(db.Integer, nullable=False)
    amount = db.Column(db.Float, nullable=False)
コード例 #8
0
class OrderModel(db.Model):
    __tablename__ = 'order'
    id = db.Column(db.Integer, primary_key=True)
    amount = db.Column(db.Integer, nullable=False)
    shipment = db.Column(db.String(100), nullable=False)
    ship_Address = db.Column(db.String(100), nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
コード例 #9
0
class UserAddress(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    address = db.Column(db.String(250), nullable=False)
    user_id = db.Column(db.Integer,
                        db.ForeignKey('user.id'),
                        nullable=False,
                        Unique=True)
コード例 #10
0
class Cart(db.Model):
    __tablename__ = 'cart'
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
コード例 #11
0
class Productmeta(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    image_path = db.Column(db.String(100), nullable=False)
    product_id = db.Column(db.Integer, db.ForeignKey('product.id'))
コード例 #12
0
class PaymentModel(db.Model):
    __tablename__ = 'payment'
    id = db.Column(db.Integer, primary_key=True)
    payment_type = db.Column(db.String(200), nullable=False)
    amount = db.Column(db.Integer, nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
コード例 #13
0
class Product(db.Model):
    __tablename__ = 'product'
    id = db.Column(db.Integer, primary_key=True)
    product_name = db.Column(db.String(100), nullable=False)
    product_price = db.Column(db.Float, nullable=False)
    product_category_id = db.Column(db.Integer, db.ForeignKey('category.id'))
コード例 #14
0
class WhislistModel(db.model):
    __tablename__ = 'Mywhislist'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
コード例 #15
0
class OrderProduct(db.Model):
    _tablename__ = 'orderproduct'
    id = db.Column(db.Integer, primary_key=True)
    order_id = db.Column(db.Integer, db.ForeignKey('order.id'))
    product_id = db.Column(db.Integer, db.ForeignKey('product.id'))
コード例 #16
0
class TreePath(db.Model):
    __tablename__ = 'Treepath'
    id = db.Column(db.Integer, primary_key=True)
    ancestor = db.Column(db.Integer, db.ForeignKey('category.id'))
    descendants = db.Column(db.Integer, db.ForeignKey('category.id'))