From 22db8e398e5291cf6bd80018376d907682ab6298 Mon Sep 17 00:00:00 2001 From: Michael Drury <mpdrury15@gmail.com> Date: Wed, 3 May 2023 13:01:32 +0100 Subject: [PATCH] added comments for databases.py --- shop/databases.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shop/databases.py b/shop/databases.py index 50c08f8..3120cf2 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) -- GitLab