Example #1
0
class Students(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    forename = db.Column(db.String(60), nullable=False)
    surname = db.Column(db.String(60), nullable=False)
    year = db.Column(db.Integer)
    email = db.Column(db.String(60), nullable=False)
    mobile = db.Column(db.String(12))
    type = db.Column(db.String(1), nullable=False)
Example #2
0
class Vendors(db.Model):  #Company info (company name, company email etc.)
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(60), nullable=False, unique=True)
    email = db.Column(db.String(60), nullable=True, unique=True)
    mobile = db.Column(db.String(12), nullable=True, unique=True)
    userID = db.Column(db.Integer, db.ForeignKey("users.id"), nullable=True)

    products = db.relationship("Products")
Example #3
0
class Products(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(60), nullable=False, unique=True)
    description = db.Column(db.String(255))
    vendorID = db.Column(db.Integer,
                         db.ForeignKey("vendors.id"),
                         nullable=True)
    price = db.Column(db.Float, nullable=False)

    orders = db.relationship("Orders")
Example #4
0
class Users(db.Model, UserMixin):
    id = db.Column(db.Integer, primary_key=True)
    forename = db.Column(db.String(60), nullable=False)
    surname = db.Column(db.String(60), nullable=True)
    email = db.Column(db.String(110), nullable=False, unique=True)
    mobile = db.Column(db.String(12), nullable=True, unique=True)
    password = db.Column(db.String(60), nullable=False)
    admin = db.Column(db.Integer, nullable=False)

    vendor = db.relationship("Vendors")
Example #5
0
class Customers(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    forename = db.Column(db.String(60), nullable=False)
    surname = db.Column(db.String(60), nullable=False)
    email = db.Column(db.String(60), nullable=False)
    mobile = db.Column(db.String(12), nullable=False)
    street = db.Column(db.String(60), nullable=False)
    suburb = db.Column(db.String(60), nullable=False)
    city = db.Column(db.String(60))
    state = db.Column(db.String(60))
    postcode = db.Column(db.String(4))

    order = db.relationship("Orders")