diff --git a/app.py b/app.py index 1edbc3c..ce5e75b 100644 --- a/app.py +++ b/app.py @@ -15,6 +15,7 @@ def main(): if secret_key == None: # NO Secret Key set! print("No app secret set, please set one before deploying in production") + print("This is a test") app.secret_key = "DEFAULTKEY" else: app.secret_key = secret_key diff --git a/controllers/web/product.py b/controllers/web/product.py index 7a89c9c..3d94aa9 100644 --- a/controllers/web/product.py +++ b/controllers/web/product.py @@ -6,6 +6,8 @@ from controllers.database.category import CategoryController blueprint = Blueprint("products", __name__, url_prefix="/products") +# Global context to enable the categories to be accessed +# from any view @blueprint.context_processor def category_list(): database = CategoryController() diff --git a/scripts/create_tables.sql b/scripts/create_tables.sql index 1d0eb10..5a1be62 100644 --- a/scripts/create_tables.sql +++ b/scripts/create_tables.sql @@ -46,13 +46,13 @@ INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALU INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); -INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); -INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); -INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); -INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); -INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); -INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); -INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1); +INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 2, 2); +INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 3, 3); +INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 3, 3); +INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 3, 3); +INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 6, 6); +INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 6, 6); +INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 5, 5); CREATE TABLE IF NOT EXISTS Orders ( id INTEGER PRIMARY KEY,