コード例 #1
0
class Product(db.Model):
    product_id = db.Column(db.Integer, primary_key=True)
    product_name = db.Column(db.String(100), nullable=False, unique=True)
    price = db.Column(db.Numeric(12, 2), nullable=False)

    def __repr__(self):
        return '<Product %r>' % self.product_name
コード例 #2
0
class Order_Return(db.Model):
    return_id = db.Column(db.Integer, primary_key=True)
    order_id = db.Column(db.Integer,
                         db.ForeignKey('order.order_id'),
                         nullable=False)
    return_date = db.Column(db.DateTime, nullable=False)

    def __repr__(self):
        return '<Order_Return %r>' % self.return_id
コード例 #3
0
class Review(db.Model):
    review_id = db.Column(db.Integer, primary_key=True)
    customer_id = db.Column(db.Integer,
                            db.ForeignKey('customer.customer_id'),
                            nullable=False)
    content = db.Column(db.String(10000), nullable=False)
    review_date = db.Column(db.DateTime, nullable=False)

    def __repr__(self):
        return '<Review %r>' % self.review_id
コード例 #4
0
class Degustation_Customer(db.Model):
    id = db.Column(db.Integer, nullable=False, primary_key=True)
    degustation_id = db.Column(db.Integer,
                               db.ForeignKey('degustation.degustation_id'),
                               nullable=False)
    customer_id = db.Column(db.Integer,
                            db.ForeignKey('customer.customer_id'),
                            nullable=False)

    def __repr__(self):
        return '<Degustation_Customer %r>' % self.degustation_id
コード例 #5
0
class Sort_Product(db.Model):
    id = db.Column(db.Integer, nullable=False, primary_key=True)
    sort_id = db.Column(db.Integer,
                        db.ForeignKey('sort.sort_id'),
                        nullable=False)
    product_id = db.Column(db.Integer,
                           db.ForeignKey('product.product_id'),
                           nullable=False)

    def __repr__(self):
        return '<Sort_Product %r>' % self.product_id
コード例 #6
0
class Trip_Agronomist(db.Model):
    id = db.Column(db.Integer, nullable=False, primary_key=True)
    agronomist_id = db.Column(db.Integer,
                              db.ForeignKey('agronomist.agronomist_id'),
                              nullable=False)
    trip_id = db.Column(db.Integer,
                        db.ForeignKey('trip.trip_id'),
                        nullable=False)

    def __repr__(self):
        return '<Trip_Agronomist %r>' % self.trip_id
コード例 #7
0
class Harvest(db.Model):
    harvest_id = db.Column(db.Integer, primary_key=True)
    sort_id = db.Column(db.Integer,
                        db.ForeignKey('sort.sort_id'),
                        nullable=False)
    agronomist_id = db.Column(db.Integer,
                              db.ForeignKey('agronomist.agronomist_id'),
                              nullable=False)
    harvest_date = db.Column(db.DateTime, nullable=False)

    def __repr__(self):
        return '<Harvest %r>' % self.harvest_id
コード例 #8
0
class Degustation(db.Model):
    degustation_id = db.Column(db.Integer, primary_key=True)
    agronomist_id = db.Column(db.Integer,
                              db.ForeignKey('agronomist.agronomist_id'),
                              nullable=False)
    product_id = db.Column(db.Integer,
                           db.ForeignKey('product.product_id'),
                           nullable=False)
    degustation_date = db.Column(db.DateTime, nullable=False)

    def __repr__(self):
        return '<Degustation %r>' % self.degustation_id
コード例 #9
0
class Ordering(db.Model):
    order_id = db.Column(db.Integer, primary_key=True)
    agronomist_id = db.Column(db.Integer,
                              db.ForeignKey('agronomist.agronomist_id'),
                              nullable=False)
    customer_id = db.Column(db.Integer,
                            db.ForeignKey('customer.customer_id'),
                            nullable=False)
    product_id = db.Column(db.Integer,
                           db.ForeignKey('product.product_id'),
                           nullable=False)
    weight = db.Column(db.Numeric(12, 2), nullable=False)
    total_price = db.Column(db.Numeric(12, 2), nullable=False)
    order_date = db.Column(db.DateTime, nullable=False)

    def __repr__(self):
        return '<Order %r>' % self.order_id
コード例 #10
0
class Customer(db.Model):
    customer_id = db.Column(db.Integer, primary_key=True)
    customer_name = db.Column(db.String(100), nullable=False)

    def __repr__(self):
        return '<Customer %r>' % self.customer_name
コード例 #11
0
class Agronomist(db.Model):
    agronomist_id = db.Column(db.Integer, primary_key=True)
    agronomist_name = db.Column(db.String(100), nullable=False)

    def __repr__(self):
        return '<Agronomist %r>' % self.agronomist_name
コード例 #12
0
class Trip(db.Model):
    trip_id = db.Column(db.Integer, primary_key=True)
    trip_date = db.Column(db.DateTime, nullable=False)

    def __repr__(self):
        return '<Trip %r>' % self.trip_id
コード例 #13
0
class Sort(db.Model):
    sort_id = db.Column(db.Integer, primary_key=True)
    sort_name = db.Column(db.String(100), nullable=False, unique=True)

    def __repr__(self):
        return '<Sort %r>' % self.sort_name