class Tenant(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), unique=True, nullable=False) email = db.Column(db.String(120), unique=True, nullable=True) def __repr__(self): return '<User %r>' % self.username
class Menu(db.Model): id = db.Column(db.Integer, primary_key=True) orderName = db.Column(db.String(50), nullable=False) description = db.Column(db.Text, nullable=False) price = db.Column(db.String(50), nullable=False) section = db.Column(db.Integer, nullable=False) def __repr__(self): return f"Order('{self.orderName}')"
class Restaurant_name(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(80), nullable=False) user = db.Column(db.String(80), nullable=False) def __init__(self, name, user): self.name = name self.user = user def __repr__(self): return '<Restaurant %r>' % self.name
class Menu_items(db.Model): id = db.Column(db.Integer, primary_key=True) course = db.Column(db.String(80)) menu_name = db.Column(db.String(80), nullable=False) description = db.Column(db.String(250)) price = db.Column(db.Integer) image = db.Column(db.String(80)) user = db.Column(db.String(80), nullable=False) restaurant_id = db.Column(db.Integer, db.ForeignKey('restaurant_name.id')) @property def imgsrc(self): return uploaded_images.url(self.image) def __init__(self, course, menu_name, description, price, image, user, restaurant_id): self.course = course self.menu_name = menu_name self.description = description self.price = price self.image = image self.user = user self.restaurant_id = restaurant_id def __repr__(self): return '<Menu item %r>' % self.menu_name
class Login(db.Model): id = db.Column(db.Integer,primary_key = True) username = db.Column(db.String(50)) email = db.Column(db.String(50)) password = db.Column(db.String(20)) image = db.Column(db.String(50)) usertype = db.Column(db.String(20))
class AddContact(db.Model): id = db.Column(db.Integer, primary_key=True) firstname = db.Column(db.VARCHAR(200), nullable=False) lastname = db.Column(db.VARCHAR(200), nullable=False) email = db.Column(db.VARCHAR(200), nullable=False) subject = db.Column(db.VARCHAR(200), nullable=False) message = db.Column(db.VARCHAR(200), nullable=False)
class AddFood(db.Model): id = db.Column(db.Integer, primary_key=True) itemtype = db.Column(db.VARCHAR(200), nullable=False) timeinterval = db.Column(db.VARCHAR(200), nullable=False) category = db.Column(db.VARCHAR(200), nullable=False) foodname = db.Column(db.VARCHAR(200), nullable=False) amount = db.Column(db.VARCHAR(200), nullable=False)
class Order(db.Model): id = db.Column(db.Integer, primary_key=True) orderName = db.Column(db.String(50), nullable=False) description = db.Column(db.Text, nullable=False) price = db.Column(db.String(50), nullable=False) userID = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) complete = db.Column(db.Boolean, default=False, nullable=False) def __repr__(self): return f"Order('{self.orderName}')"
class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(25), unique=True, nullable=False) email = db.Column(db.String(125), unique=True, nullable=False) image_icon = db.Column(db.String(20), nullable=False, default='default.jpg') password = db.Column(db.String(60), nullable=False) points = db.Column(db.Integer, default=0) orders = db.relationship('Order', backref='customer', lazy=True) def __repr__(self): return f"User('{self.username}', '{self.email}')"
class AddCategory(db.Model): id = db.Column(db.Integer, primary_key=True) category = db.Column(db.VARCHAR(200), nullable=False) def __repr__(self): return '<Task %r>' % self.id