diff --git a/shop/databases.py b/shop/databases.py index 50c08f844e147a6d43f57e6106da388fcce601c5..3120cf2fbee9ece0666ddf325d784794da49b826 100644 --- a/shop/databases.py +++ b/shop/databases.py @@ -2,6 +2,8 @@ from werkzeug.security import generate_password_hash, check_password_hash from flask_login import UserMixin from . import db +# Usertable which also stores the users wishlist and cart as a string of item ids split up by spaces + class User(UserMixin, db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) @@ -34,7 +36,7 @@ class User(UserMixin, db.Model): def __repr__(self): return '<User {0}>'.format(self.username) - +# stores all of the information for the projects class product_table(db.Model): __tablename__ = 'products' product_id = db.Column(db.Integer, primary_key=True) @@ -53,6 +55,7 @@ class product_table(db.Model): product_description = description_in)) db.session.commit() +# stores the reviews as well as the author of the review class review_table(db.Model): __tablename__ = 'reviews' review_id = db.Column(db.Integer, primary_key=True)