예제 #1
0
class ProductGender(db.Model):
    __table_args__ = {'extend_existing': True}
    genderid = db.Column(db.Integer, db.ForeignKey('gender.genderid'), nullable=False, primary_key=True)
    productid = db.Column(db.Integer, db.ForeignKey('product.productid'), nullable=False, primary_key=True)
    created_on = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)

    def __repr__(self):
        return f"Product('{self.genderid}', '{self.productid}')"
예제 #2
0
class Cart(db.Model):
    __table_args__ = {'extend_existing': True}
    userid = db.Column(db.Integer, db.ForeignKey('user.userid'), nullable=False, primary_key=True)
    productid = db.Column(db.Integer, db.ForeignKey('product.productid'), nullable=False, primary_key=True)
    sizeid = db.Column(db.Integer, db.ForeignKey('size.sizeid'), nullable=False)
    quantity = db.Column(db.Integer, nullable=False)

    def __repr__(self):
        return f"Cart('{self.userid}', '{self.productid}, '{self.sizeid}, '{self.quantity}')"
예제 #3
0
class OrderedProduct(db.Model):
    __table_args__ = {'extend_existing': True}
    ordproductid = db.Column(db.Integer, primary_key=True)
    orderid = db.Column(db.Integer,db.ForeignKey('order.orderid'), nullable=False)
    productid = db.Column(db.Integer,db.ForeignKey('product.productid'))
    sizeid = db.Column(db.Integer, db.ForeignKey('size.sizeid'))
    quantity = db.Column(db.Integer, nullable=False)

    def __repr__(self):
        return f"Order('{self.ordproductid}', '{self.orderid}','{self.productid}', '{self.sizeid},'{self.quantity}')"
예제 #4
0
class Size(db.Model):
    __table_args__ = {'extend_existing': True}
    sizeid = db.Column(db.Integer, primary_key=True)
    size_name = db.Column(db.String(20), nullable=False)
    productid = db.Column(db.Integer, db.ForeignKey('product.productid'), nullable=False)
    quantity = db.Column(db.Integer)

    def __repr__(self):
        return f"Size('{self.sizeid}','{self.size_name}','{self.productid}', '{self.quantity}')"
예제 #5
0
class Refund(db.Model):
    __table_args__ = {'extend_existing': True}
    refundid = db.Column(db.Integer, primary_key=True)
    ordproductid = db.Column(db.Integer, db.ForeignKey('ordered_product.ordproductid'), nullable=False)
    quantity = db.Column(db.Integer, nullable=False)
    created_on = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)

    def __repr__(self):
        return f"Refund('{self.ordproductid}', '{self.quantity}')"
예제 #6
0
class Order(db.Model):
    __table_args__ = {'extend_existing': True}
    orderid = db.Column(db.Integer, primary_key=True)
    order_date = db.Column(db.DateTime, nullable=False)
    total_price = db.Column(db.DECIMAL, nullable=False)
    userid = db.Column(db.Integer, db.ForeignKey('user.userid'), nullable=False)


    def __repr__(self):
        return f"Order('{self.orderid}', '{self.order_date}','{self.total_price}','{self.userid}'')"
예제 #7
0
class SaleTransaction(db.Model):
    __table_args__ = {'extend_existing': True}
    transactionid = db.Column(db.Integer, primary_key=True)
    orderid = db.Column(db.Integer,db.ForeignKey('order.orderid'), nullable=False)
    transaction_date = db.Column(db.DateTime,nullable=False)
    amount = db.Column(db.DECIMAL, nullable=False)
    cc_number=db.Column(db.String(50), nullable=False)
    cc_type = db.Column(db.String(50), nullable=False)
    full_name = db.Column(db.String(50))
    address = db.Column(db.String(100))
    response = db.Column(db.String(50))


    def __repr__(self):
        return f"Order('{self.transactionid}', '{self.orderid}','{self.transactiondate}','{self.amount}', '{self.cc_number}','{self.cc_type}','{self.response}')"